mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
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:
parent
bac7628eae
commit
f08a3371b0
@ -1389,8 +1389,8 @@ impl<'tcx> InferCtxt<'tcx> {
|
||||
where
|
||||
T: TypeFoldable<'tcx>,
|
||||
{
|
||||
if !value.needs_infer() {
|
||||
return value; // Avoid duplicated subst-folding.
|
||||
if !value.has_non_region_infer() {
|
||||
return value;
|
||||
}
|
||||
let mut r = resolve::OpportunisticVarResolver::new(self);
|
||||
value.fold_with(&mut r)
|
||||
|
Loading…
Reference in New Issue
Block a user