]> git.lizzy.rs Git - rust.git/blob - tests/ui/coherence/coherence-overlap-downstream.rs
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / coherence / coherence-overlap-downstream.rs
1 // Tests that we consider `T: Sugar + Fruit` to be ambiguous, even
2 // though no impls are found.
3
4 pub trait Sugar {}
5 pub trait Fruit {}
6 pub trait Sweet {}
7 impl<T:Sugar> Sweet for T { }
8 impl<T:Fruit> Sweet for T { }
9 //~^ ERROR E0119
10
11 pub trait Foo<X> {}
12 pub trait Bar<X> {}
13 impl<X, T> Foo<X> for T where T: Bar<X> {}
14 impl<X> Foo<X> for i32 {}
15 //~^ ERROR E0119
16
17 fn main() { }