aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/code_model.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index fb85041fd..b65be4fe1 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -1411,7 +1411,7 @@ impl Type {
1411 r#trait: Trait, 1411 r#trait: Trait,
1412 args: &[Type], 1412 args: &[Type],
1413 alias: TypeAlias, 1413 alias: TypeAlias,
1414 ) -> Option<Ty> { 1414 ) -> Option<Type> {
1415 let subst = Substs::build_for_def(db, r#trait.id) 1415 let subst = Substs::build_for_def(db, r#trait.id)
1416 .push(self.ty.value.clone()) 1416 .push(self.ty.value.clone())
1417 .fill(args.iter().map(|t| t.ty.value.clone())) 1417 .fill(args.iter().map(|t| t.ty.value.clone()))
@@ -1432,6 +1432,10 @@ impl Type {
1432 Solution::Unique(SolutionVariables(subst)) => subst.value.first().cloned(), 1432 Solution::Unique(SolutionVariables(subst)) => subst.value.first().cloned(),
1433 Solution::Ambig(_) => None, 1433 Solution::Ambig(_) => None,
1434 } 1434 }
1435 .map(|ty| Type {
1436 krate: self.krate,
1437 ty: InEnvironment { value: ty, environment: Arc::clone(&self.ty.environment) },
1438 })
1435 } 1439 }
1436 1440
1437 pub fn is_copy(&self, db: &dyn HirDatabase) -> bool { 1441 pub fn is_copy(&self, db: &dyn HirDatabase) -> bool {