Don't be so eager to call unresolved inference variables an error. MC
is being used now before the final regionck stage and in some cases SOME amount of unresolved inference is OK. In fact, we could probably just allow inference variables as well with only minimal pain.
This commit is contained in:
parent
4172c8237b
commit
a551697134
@ -1162,7 +1162,15 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||
/// these unconstrained type variables.
|
||||
fn resolve_type_vars_or_error(&self, t: &Ty<'tcx>) -> mc::McResult<Ty<'tcx>> {
|
||||
let ty = self.resolve_type_vars_if_possible(t);
|
||||
if ty.has_infer_types() || ty.references_error() { Err(()) } else { Ok(ty) }
|
||||
if ty.references_error() {
|
||||
debug!("resolve_type_vars_or_error: error from {:?}", ty);
|
||||
Err(())
|
||||
} else if ty.is_ty_var() {
|
||||
debug!("resolve_type_vars_or_error: error from {:?}", ty);
|
||||
Err(())
|
||||
} else {
|
||||
Ok(ty)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn fully_resolve<T:TypeFoldable<'tcx>>(&self, value: &T) -> FixupResult<T> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user