blob: 9339518aae1a0f9e5e4fb287ae0c08659ee3fafb [file] [edit]
//@ check-pass
//@ revisions: current next
//@ ignore-compare-mode-next-solver (explicit revisions)
//@[next] compile-flags: -Znext-solver
// In `fn hrtb` normalizing the elaborated where-clause
// `T: for<'a> Supertrait<<&'a () as WithAssoc>::As>` results in
// a region error as `&'a ()` is not `'static`.
//
// This happens even though the where-clauses themselves are well-formed
// as we never have to prove `&'a (): WithAssoc` as `'a` is a bound variable.
//
// Unlike `normalize-param-env-missing-implied-bound-1.rs` this snippet caused
// an ICE with the old trait solver, as we did register region constraints from
// relating types. This ICE was tracked in #136661.
#![allow(unused)]
trait Supertrait<T> {}
trait Other {
fn method(&self) {}
}
impl WithAssoc for &'static () {
type As = ();
}
trait WithAssoc {
type As;
}
trait Trait<P: WithAssoc>: Supertrait<P::As> {
fn method(&self) {}
}
fn hrtb<T: for<'a> Trait<&'a ()>>() {}
pub fn main() {}