diff options
Diffstat (limited to 'crates/hir/src')
-rw-r--r-- | crates/hir/src/code_model.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 031c91ccf..9aaa280c8 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs | |||
@@ -1372,7 +1372,7 @@ impl Type { | |||
1372 | r#trait: Trait, | 1372 | r#trait: Trait, |
1373 | args: &[Type], | 1373 | args: &[Type], |
1374 | alias: TypeAlias, | 1374 | alias: TypeAlias, |
1375 | ) -> Option<Ty> { | 1375 | ) -> Option<Type> { |
1376 | let subst = Substs::build_for_def(db, r#trait.id) | 1376 | let subst = Substs::build_for_def(db, r#trait.id) |
1377 | .push(self.ty.value.clone()) | 1377 | .push(self.ty.value.clone()) |
1378 | .fill(args.iter().map(|t| t.ty.value.clone())) | 1378 | .fill(args.iter().map(|t| t.ty.value.clone())) |
@@ -1393,6 +1393,10 @@ impl Type { | |||
1393 | Solution::Unique(SolutionVariables(subst)) => subst.value.first().cloned(), | 1393 | Solution::Unique(SolutionVariables(subst)) => subst.value.first().cloned(), |
1394 | Solution::Ambig(_) => None, | 1394 | Solution::Ambig(_) => None, |
1395 | } | 1395 | } |
1396 | .map(|ty| Type { | ||
1397 | krate: self.krate, | ||
1398 | ty: InEnvironment { value: ty, environment: Arc::clone(&self.ty.environment) }, | ||
1399 | }) | ||
1396 | } | 1400 | } |
1397 | 1401 | ||
1398 | pub fn is_copy(&self, db: &dyn HirDatabase) -> bool { | 1402 | pub fn is_copy(&self, db: &dyn HirDatabase) -> bool { |