Change:
<!-- Thank you for finding an Internal Compiler Error! If possible, try to provide a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for how to create smaller examples. --<!-- If you're using the stable version of the compiler, you should also check if the bug also exists in the beta or nightly versions. --: <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Started crashing with Regression in nightly-2022-05-19 commit[0] 2022-05-17: Auto merge of - jsha:rustdoc-search-refactor, r=GuillaumeGomez commit[1] 2022-05-18: Auto merge of - JohnTitor:rollup-7gdt2aw, r=JohnTitor commit[2] 2022-05-18: Auto merge of - Dylan-DPC:rollup-06u9pqn, r=Dylan-DPC commit[3] 2022-05-18: Auto merge of - Kobzol:pgo-pid-in-profile, r=lqd commit[4] 2022-05-18: Auto merge of - michaelwoerister:path-prefix-fixes-2, r=davidtwco commit[5] 2022-05-18: Auto merge of - nbdd0121:const, r=nagisa commit[6] 2022-05-18: Auto merge of - SparrowLii:let, r=michaelwoerister commit[7] 2022-05-18: Auto merge of - b-naber:transition-to-valtrees-pt1, r=oli-obk
WG-prioritization assigning priority (). label -I-prioritize +P-medium -needs-triage

Discussion:
real_trait_pred = parent_trait_pred; } <del> let real_ty = real_trait_pred.self_ty(); </del> // We `erase_late_bound_regions` here because `make_subregion` does not handle // `ReLateBound`, and we don't particularly care about the regions. <del> if !self.can_eq( obligation.param_env, self.tcx.erase_late_bound_regions(real_ty), arg_ty, ) { </del> <ins> let real_ty = self.tcx.erase_late_bound_regions(real_trait_pred.self_ty()); if !self.can_eq(obligation.param_env, real_ty, arg_ty) { </ins> continue; } <del> if let ty::Ref(region, base_ty, mutbl) = *real_ty.skip_binder().kind() { </del> <ins> if let ty::Ref(region, base_ty, mutbl) = *real_ty.kind() { </ins> let autoderef = (self.autoderef_steps)(base_ty); if let Some(steps) = autoderef.into_iter().enumerate().find_map(|(steps, (ty, obligations))| {

<ins> // issue:113951 trait Foo<'x, T> {} trait RefFoo<T> { fn ref_foo(&self); } impl<T> RefFoo<T> for T where for<'a> &'a mut Vec<&'a u32>: Foo<'static, T>, { fn ref_foo(&self) {} } fn coerce_lifetime2() { <i32 as RefFoo<i32>>::ref_foo(unknown); //~^ ERROR cannot find value `unknown` in this scope //~| ERROR the trait bound `for<'a> &'a mut Vec<&'a u32>: Foo<'static, i32>` is not satisfied } fn main() {} </ins>

<ins> error[E0425]: cannot find value `unknown` in this scope --> $DIR/dont-autoderef-ty-with-escaping-var.rs:17:35 | LL |     <i32 as RefFoo<i32>>::ref_foo(unknown); |                                   ^^^^^^^ not found in this scope error[E0277]: the trait bound `for<'a> &'a mut Vec<&'a u32>: Foo<'static, i32>` is not satisfied --> $DIR/dont-autoderef-ty-with-escaping-var.rs:17:35 | LL |     <i32 as RefFoo<i32>>::ref_foo(unknown); |     ----------------------------- ^^^^^^^ the trait `for<'a> Foo<'static, i32>` is not implemented for `&'a mut Vec<&'a u32>` |     | |     required by a bound introduced by this call | note: required for `i32` to implement `RefFoo<i32>` --> $DIR/dont-autoderef-ty-with-escaping-var.rs:9:9 | LL | impl<T> RefFoo<T> for T |         ^^^^^^^^^     ^ LL | where LL |     for<'a> &'a mut Vec<&'a u32>: Foo<'static, T>, |                                   --------------- unsatisfied trait bound introduced here error: aborting due to 2 previous errors Some errors have detailed explanations: E0277, E0425. For more information about an error, try `rustc --explain E0277`. </ins>