aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src/code_model.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir/src/code_model.rs')
-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 650b4fa40..a101d724e 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -1389,7 +1389,7 @@ impl Type {
1389 r#trait: Trait, 1389 r#trait: Trait,
1390 args: &[Type], 1390 args: &[Type],
1391 alias: TypeAlias, 1391 alias: TypeAlias,
1392 ) -> Option<Ty> { 1392 ) -> Option<Type> {
1393 let subst = Substs::build_for_def(db, r#trait.id) 1393 let subst = Substs::build_for_def(db, r#trait.id)
1394 .push(self.ty.value.clone()) 1394 .push(self.ty.value.clone())
1395 .fill(args.iter().map(|t| t.ty.value.clone())) 1395 .fill(args.iter().map(|t| t.ty.value.clone()))
@@ -1410,6 +1410,10 @@ impl Type {
1410 Solution::Unique(SolutionVariables(subst)) => subst.value.first().cloned(), 1410 Solution::Unique(SolutionVariables(subst)) => subst.value.first().cloned(),
1411 Solution::Ambig(_) => None, 1411 Solution::Ambig(_) => None,
1412 } 1412 }
1413 .map(|ty| Type {
1414 krate: self.krate,
1415 ty: InEnvironment { value: ty, environment: Arc::clone(&self.ty.environment) },
1416 })
1413 } 1417 }
1414 1418
1415 pub fn is_copy(&self, db: &dyn HirDatabase) -> bool { 1419 pub fn is_copy(&self, db: &dyn HirDatabase) -> bool {