1
Fork 0

Unwrap the results of type folders

Co-authored-by: Alan Egerton <eggyal@gmail.com>
This commit is contained in:
LeSeulArtichaut 2021-05-19 15:03:43 +02:00 committed by Alan Egerton
parent 6dc3dae46f
commit 30bf20a692
No known key found for this signature in database
GPG key ID: 07CAC3CCA7E0643F
34 changed files with 191 additions and 167 deletions

View file

@ -681,7 +681,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
}
pub fn freshen<T: TypeFoldable<'tcx>>(&self, t: T) -> T {
t.fold_with(&mut self.freshener())
t.fold_with(&mut self.freshener()).into_ok()
}
/// Returns the origin of the type variable identified by `vid`, or `None`
@ -1381,7 +1381,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
where
T: TypeFoldable<'tcx>,
{
value.fold_with(&mut ShallowResolver { infcx: self })
value.fold_with(&mut ShallowResolver { infcx: self }).into_ok()
}
pub fn root_var(&self, var: ty::TyVid) -> ty::TyVid {
@ -1402,7 +1402,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
return value; // Avoid duplicated subst-folding.
}
let mut r = resolve::OpportunisticVarResolver::new(self);
value.fold_with(&mut r)
value.fold_with(&mut r).into_ok()
}
/// Returns the first unresolved variable contained in `T`. In the