]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-overlap-downstream.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / 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 // revisions: old re
5
6 #![cfg_attr(re, feature(re_rebalance_coherence))]
7
8 pub trait Sugar {}
9 pub trait Fruit {}
10 pub trait Sweet {}
11 impl<T:Sugar> Sweet for T { }
12 impl<T:Fruit> Sweet for T { }
13 //[old]~^ ERROR E0119
14 //[re]~^^ ERROR E0119
15
16 pub trait Foo<X> {}
17 pub trait Bar<X> {}
18 impl<X, T> Foo<X> for T where T: Bar<X> {}
19 impl<X> Foo<X> for i32 {}
20 //[old]~^ ERROR E0119
21 //[re]~^^ ERROR E0119
22
23 fn main() { }