]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-cow.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / coherence / coherence-cow.rs
1 // revisions: a b c re_a re_b re_c
2
3 #![cfg_attr(any(re_a, re_b, re_c), feature(re_rebalance_coherence))]
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(a, re_a))]
18 impl<T> Remote for Pair<T,Cover<T>> { }
19 //[a]~^ ERROR E0210
20 //[re_a]~^^ ERROR E0117
21
22 #[cfg(any(b, re_b))]
23 impl<T> Remote for Pair<Cover<T>,T> { }
24 //[b]~^ ERROR E0210
25 //[re_b]~^^ ERROR E0117
26
27 #[cfg(any(c, re_c))]
28 impl<T,U> Remote for Pair<Cover<T>,U> { }
29 //[c]~^ ERROR type parameter `T` must be used as the type parameter for some local type
30 //[re_c]~^^ ERROR E0117
31
32 fn main() { }