Skip to content

Commit 4295875

Browse files
authored
Merge pull request #22135 from ChayimFriedman2/mono-infer
fix: Suppress infer vars in monomorphization
2 parents a74a2d9 + 74650c9 commit 4295875

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

crates/hir-ty/src/mir/monomorphization.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ impl<'db> FallibleTypeFolder<DbInterner<'db>> for Filler<'db> {
6565
ty,
6666
)
6767
.map_err(|_| MirLowerError::NotSupported("can't normalize alias".to_owned()))?;
68+
// Normalization could introduce infer vars (for example, if the alias cannot be normalized),
69+
// and we must not have infer vars in the body.
70+
let ty = ty.replace_infer_with_error(self.infcx.interner);
6871
ty.try_super_fold_with(self)
6972
}
7073
TyKind::Param(param) => Ok(self

0 commit comments

Comments
 (0)