diff options
| author | Michael Goulet <michael@errs.io> | 2025-06-28 20:46:46 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-06-28 20:48:58 +0000 |
| commit | ed16ae851bdb840ab2e7776e343ef865bfcbb76d (patch) | |
| tree | a2c5f146aee53d5b7dad5f8bc77d14b3c6633682 /compiler/rustc_infer/src | |
| parent | b63223c152212832ce37a109e26cc5f84c577532 (diff) | |
| download | rust-ed16ae851bdb840ab2e7776e343ef865bfcbb76d.tar.gz rust-ed16ae851bdb840ab2e7776e343ef865bfcbb76d.zip | |
Do not freshen ReError
Diffstat (limited to 'compiler/rustc_infer/src')
| -rw-r--r-- | compiler/rustc_infer/src/infer/freshen.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_infer/src/infer/freshen.rs b/compiler/rustc_infer/src/infer/freshen.rs index cae674165f0..ddc0b116806 100644 --- a/compiler/rustc_infer/src/infer/freshen.rs +++ b/compiler/rustc_infer/src/infer/freshen.rs @@ -110,17 +110,16 @@ impl<'a, 'tcx> TypeFolder<TyCtxt<'tcx>> for TypeFreshener<'a, 'tcx> { fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> { match r.kind() { - ty::ReBound(..) => { - // leave bound regions alone - r - } + // Leave bound regions alone, since they affect selection via the leak check. + ty::ReBound(..) => r, + // Leave error regions alone, since they affect selection b/c of incompleteness. + ty::ReError(_) => r, ty::ReEarlyParam(..) | ty::ReLateParam(_) | ty::ReVar(_) | ty::RePlaceholder(..) | ty::ReStatic - | ty::ReError(_) | ty::ReErased => self.cx().lifetimes.re_erased, } } |
