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. --Minimized: also occurs for but not <!-- 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. --: also on Rust Playground <!-- Include a backtrace in the code block by setting in your environment. E.g. . --<details<summary<strongBacktrace</strong</summary<p</p</details
Somehow I missed that this does not require async. Also crashes with and returning .
minimized:
-- the minimization no longer ICEs for me
-- this sure looks like a dup of
After a discussion with Niko about this and assigning to myself we saw that there's already a PR. Unassigning myself then :).

Discussion:
debug!(?concrete_type, ?substs); let mut subst_regions = vec![self.universal_regions.fr_static]; <del> let universal_substs = infcx.tcx.fold_regions(substs, &mut false, |region, _| match *region { ty::ReVar(vid) => { subst_regions.push(vid); self.definitions[vid].external_name.unwrap_or_else(|| { infcx.tcx.sess.delay_span_bug( span, "opaque type with non-universal region substs", ); infcx.tcx.lifetimes.re_static }) } // We don't fold regions in the predicates of opaque // types to `ReVar`s. This means that in a case like // // fn f<'a: 'a>() -> impl Iterator<Item = impl Sized> // // The inner opaque type has `'static` in its substs. ty::ReStatic => region, _ => { infcx.tcx.sess.delay_span_bug( span, &format!("unexpected concrete region in borrowck: {:?}", region), ); region } }); </del> <ins> let universal_substs = infcx.tcx.fold_regions(substs, &mut false, |region, _| { let vid = self.universal_regions.to_region_vid(region); subst_regions.push(vid); self.definitions[vid].external_name.unwrap_or_else(|| { infcx .tcx .sess .delay_span_bug(span, "opaque type with non-universal region substs"); infcx.tcx.lifetimes.re_static }) }); </ins> subst_regions.sort(); subst_regions.dedup();

<del> // failure-status: 101 // rustc-env:RUST_BACKTRACE=0 // normalize-stderr-test "note: .*nn" -> "" // normalize-stderr-test "thread 'rustc' panicked.*n" -> "" // compile-flags: --crate-type=rlib // Regression test for https://github.com/rust-lang/rust/issues/78450 #![feature(min_type_alias_impl_trait)] #![no_std] pub trait AssociatedImpl { type ImplTrait; fn f() -> Self::ImplTrait; } struct S<T>(T); trait Associated { type A; } // ICE impl<'a, T: Associated<A = &'a ()>> AssociatedImpl for S<T> { type ImplTrait = impl core::fmt::Debug; fn f() -> Self::ImplTrait { //~^ ERROR unexpected concrete region in borrowck: ReEarlyBound(0, 'a) () } } </del>

<del> error: internal compiler error: unexpected concrete region in borrowck: ReEarlyBound(0, 'a) --> $DIR/associated-type-lifetime-ice.rs:29:5 | LL | /     fn f() -> Self::ImplTrait { LL | | LL | |         () LL | |     } | |_____^ | = error: internal compiler error: unexpected panic query stack during panic: end of query stack </del>

<ins> // check-pass #![feature(min_type_alias_impl_trait)] #![feature(type_alias_impl_trait)] //~^ WARNING: the feature `type_alias_impl_trait` is incomplete pub trait AssociatedImpl { type ImplTrait; fn f() -> Self::ImplTrait; } struct S<T>(T); trait Associated { type A; } impl<'a, T: Associated<A = &'a ()>> AssociatedImpl for S<T> { type ImplTrait = impl core::fmt::Debug; fn f() -> Self::ImplTrait { () } } fn main() {} </ins>

<ins> warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes --> $DIR/issue-78450.rs:4:12 | LL | #![feature(type_alias_impl_trait)] |            ^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(incomplete_features)]` on by default = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information warning: 1 warning emitted </ins>