Improve early bailout test in resolve_vars_if_possible.
`!t.has_non_region_infer()` is the test used in `OpportunisticVarResolver`, and catches a few cases that `!t.needs_infer()` misses.
This commit is contained in:
@@ -1389,8 +1389,8 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||||||
where
|
where
|
||||||
T: TypeFoldable<'tcx>,
|
T: TypeFoldable<'tcx>,
|
||||||
{
|
{
|
||||||
if !value.needs_infer() {
|
if !value.has_non_region_infer() {
|
||||||
return value; // Avoid duplicated subst-folding.
|
return value;
|
||||||
}
|
}
|
||||||
let mut r = resolve::OpportunisticVarResolver::new(self);
|
let mut r = resolve::OpportunisticVarResolver::new(self);
|
||||||
value.fold_with(&mut r)
|
value.fold_with(&mut r)
|
||||||
|
|||||||
Reference in New Issue
Block a user