]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence_local.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[rust.git] / src / test / ui / coherence / coherence_local.rs
1 // Test that we are able to introduce a negative constraint that
2 // `MyType: !MyTrait` along with other "fundamental" wrappers.
3
4 // aux-build:coherence_copy_like_lib.rs
5 // compile-pass
6 // skip-codegen
7 // revisions: old re
8
9 #![cfg_attr(re, feature(re_rebalance_coherence))]
10 #![allow(dead_code)]
11
12 extern crate coherence_copy_like_lib as lib;
13
14 struct MyType { x: i32 }
15
16 // These are all legal because they are all fundamental types:
17
18 impl lib::MyCopy for MyType { }
19 impl<'a> lib::MyCopy for &'a MyType { }
20 impl<'a> lib::MyCopy for &'a Box<MyType> { }
21 impl lib::MyCopy for Box<MyType> { }
22 impl lib::MyCopy for lib::MyFundamentalStruct<MyType> { }
23 impl lib::MyCopy for lib::MyFundamentalStruct<Box<MyType>> { }
24
25
26 fn main() { }