Skip to content

Commit f08a337

Browse files
committed
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.
1 parent bac7628 commit f08a337

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_infer/src/infer

1 file changed

+2
-2
lines changed

compiler/rustc_infer/src/infer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1389,8 +1389,8 @@ impl<'tcx> InferCtxt<'tcx> {
13891389
where
13901390
T: TypeFoldable<'tcx>,
13911391
{
1392-
if !value.needs_infer() {
1393-
return value; // Avoid duplicated subst-folding.
1392+
if !value.has_non_region_infer() {
1393+
return value;
13941394
}
13951395
let mut r = resolve::OpportunisticVarResolver::new(self);
13961396
value.fold_with(&mut r)

0 commit comments

Comments
 (0)