1
Fork 0

Rollup merge of #125865 - ajwock:ice_not_fully_resolved, r=fee1-dead

Fix ICE caused by ignoring EffectVars in type inference

Fixes #119830
​r? ```@matthiaskrgr```
This commit is contained in:
Michael Goulet 2024-06-04 08:52:13 -04:00 committed by GitHub
commit 7699da4858
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 98 additions and 11 deletions

View file

@ -587,6 +587,7 @@ pub enum FixupError {
UnresolvedFloatTy(FloatVid),
UnresolvedTy(TyVid),
UnresolvedConst(ConstVid),
UnresolvedEffect(EffectVid),
}
/// See the `region_obligations` field for more information.
@ -614,6 +615,7 @@ impl fmt::Display for FixupError {
),
UnresolvedTy(_) => write!(f, "unconstrained type"),
UnresolvedConst(_) => write!(f, "unconstrained const value"),
UnresolvedEffect(_) => write!(f, "unconstrained effect value"),
}
}
}

View file

@ -167,6 +167,9 @@ impl<'a, 'tcx> FallibleTypeFolder<TyCtxt<'tcx>> for FullTypeResolver<'a, 'tcx> {
ty::ConstKind::Infer(InferConst::Fresh(_)) => {
bug!("Unexpected const in full const resolver: {:?}", c);
}
ty::ConstKind::Infer(InferConst::EffectVar(evid)) => {
return Err(FixupError::UnresolvedEffect(evid));
}
_ => {}
}
c.try_super_fold_with(self)