// Test case for #96223. // An ICE was triggered because of a failed assertion. // Thanks to @Manishearth for the minimal test case. pub trait Foo<'de>: Sized {} pub trait Bar<'a>: 'static { type Inner: 'a; } pub trait Fubar { type Bar: for<'a> Bar<'a>; } pub struct Baz(pub T); impl<'de, T> Foo<'de> for Baz where T: Foo<'de> {} struct Empty; impl Dummy for Empty where M: Fubar, for<'de> Baz<>::Inner>: Foo<'de>, { } pub trait Dummy where M: Fubar, { } pub struct EmptyBis<'a>(&'a [u8]); impl<'a> Bar<'a> for EmptyBis<'static> { type Inner = EmptyBis<'a>; } pub struct EmptyMarker; impl Fubar for EmptyMarker { type Bar = EmptyBis<'static>; } fn icey_bounds>(p: &D) {} fn trigger_ice() { let p = Empty; icey_bounds(&p); //~ERROR } fn main() {}