From 2bb80a4f0350045503258518d354a4e63e4c68fd Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Sat, 10 Oct 2020 21:37:20 +0300 Subject: Also replace the associated types with iter --- crates/hir/src/code_model.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/hir/src') 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 { r#trait: Trait, args: &[Type], alias: TypeAlias, - ) -> Option { + ) -> Option { let subst = Substs::build_for_def(db, r#trait.id) .push(self.ty.value.clone()) .fill(args.iter().map(|t| t.ty.value.clone())) @@ -1393,6 +1393,10 @@ impl Type { Solution::Unique(SolutionVariables(subst)) => subst.value.first().cloned(), Solution::Ambig(_) => None, } + .map(|ty| Type { + krate: self.krate, + ty: InEnvironment { value: ty, environment: Arc::clone(&self.ty.environment) }, + }) } pub fn is_copy(&self, db: &dyn HirDatabase) -> bool { -- cgit v1.2.3