//@ compile-flags: -Znext-solver //@ check-pass // Normalizing `::TraitAssoc` in the elaborated environment // `[T: Trait, T: Super, ::SuperAssoc = ::TraitAssoc]` // has a single impl candidate, which uses the environment to // normalize `::TraitAssoc` to itself. We avoid this overflow // by discarding impl candidates the trait bound is proven by a where-clause. // https://github.com/rust-lang/trait-system-refactor-initiative/issues/76 trait Super { type SuperAssoc; } trait Trait: Super { type TraitAssoc; } impl Trait for T where T: Super, { type TraitAssoc = U; } fn overflow() { let x: ::TraitAssoc; } fn main() {}