blob: bf557f8633a04c92af2f323e7b4ef4dae429f1c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// compile-flags: -Znext-solver
// Check that `<T::Assoc as DiscriminantKind>::Discriminant` doesn't normalize
// to itself and cause overflow/ambiguity.
trait Foo {
type Assoc;
}
trait Bar {}
fn needs_bar(_: impl Bar) {}
fn foo<T: Foo>(x: T::Assoc) {
needs_bar(std::mem::discriminant(&x));
//~^ ERROR the trait bound `Discriminant<<T as Foo>::Assoc>: Bar` is not satisfied
}
fn main() {}
|