]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-projection-conflict-orphan.rs
Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync
[rust.git] / src / test / ui / coherence / coherence-projection-conflict-orphan.rs
1 #![feature(rustc_attrs)]
2
3 // Here we expect a coherence conflict because, even though `i32` does
4 // not implement `Iterator`, we cannot rely on that negative reasoning
5 // due to the orphan rules. Therefore, `A::Item` may yet turn out to
6 // be `i32`.
7
8 pub trait Foo<P> { fn foo() {} }
9
10 pub trait Bar {
11     type Output: 'static;
12 }
13
14 impl Foo<i32> for i32 { }
15
16 impl<A:Iterator> Foo<A::Item> for A { }
17 //~^ ERROR E0119
18
19 fn main() {}