// compile-flags: -Ztrait-solver=next // Check that `::Discriminant` doesn't normalize // to itself and cause overflow/ambiguity. trait Foo { type Assoc; } trait Bar {} fn needs_bar(_: impl Bar) {} fn foo(x: T::Assoc) { needs_bar(std::mem::discriminant(&x)); //~^ ERROR the trait bound `Discriminant<::Assoc>: Bar` is not satisfied } fn main() {}