]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-cow.rs
Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync
[rust.git] / src / test / ui / coherence / coherence-cow.rs
1 // revisions: re_a re_b re_c
2
3 #![cfg_attr(any(), re_a, re_b, re_c)]
4
5 // aux-build:coherence_lib.rs
6
7 // Test that the `Pair` type reports an error if it contains type
8 // parameters, even when they are covered by local types. This test
9 // was originally intended to test the opposite, but the rules changed
10 // with RFC 1023 and this became illegal.
11
12 extern crate coherence_lib as lib;
13 use lib::{Remote,Pair};
14
15 pub struct Cover<T>(T);
16
17 #[cfg(any(re_a))]
18 impl<T> Remote for Pair<T,Cover<T>> { }
19 //[re_a]~^ ERROR E0117
20
21 #[cfg(any(re_b))]
22 impl<T> Remote for Pair<Cover<T>,T> { }
23 //[re_b]~^ ERROR E0117
24
25 #[cfg(any(re_c))]
26 impl<T,U> Remote for Pair<Cover<T>,U> { }
27 //[re_c]~^ ERROR E0117
28
29 fn main() { }