Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir/src/lib.rs')
| -rw-r--r-- | crates/hir/src/lib.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index b5974a0cfc..d2717c5665 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -2892,7 +2892,12 @@ impl Type { }) .build(); - db.normalize_projection(projection, self.env.clone()).map(|ty| self.derived(ty)) + let ty = db.normalize_projection(projection, self.env.clone()); + if ty.is_unknown() { + None + } else { + Some(self.derived(ty)) + } } pub fn is_copy(&self, db: &dyn HirDatabase) -> bool { |