Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/mir/monomorphization.rs')
| -rw-r--r-- | crates/hir-ty/src/mir/monomorphization.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/hir-ty/src/mir/monomorphization.rs b/crates/hir-ty/src/mir/monomorphization.rs index 41044f00c2..dfce8ca2a5 100644 --- a/crates/hir-ty/src/mir/monomorphization.rs +++ b/crates/hir-ty/src/mir/monomorphization.rs @@ -65,6 +65,9 @@ impl<'db> FallibleTypeFolder<DbInterner<'db>> for Filler<'db> { ty, ) .map_err(|_| MirLowerError::NotSupported("can't normalize alias".to_owned()))?; + // Normalization could introduce infer vars (for example, if the alias cannot be normalized), + // and we must not have infer vars in the body. + let ty = ty.replace_infer_with_error(self.infcx.interner); ty.try_super_fold_with(self) } TyKind::Param(param) => Ok(self |