]> git.lizzy.rs Git - rust.git/blob - tests/ui/coherence/coherence_copy_like_err_fundamental_struct.rs
Auto merge of #106853 - TimNN:undo-remap, r=oli-obk
[rust.git] / tests / ui / coherence / coherence_copy_like_err_fundamental_struct.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 // build-pass (FIXME(62277): could be check-pass?)
6 // skip-codgen
7 #![allow(dead_code)]
8
9 extern crate coherence_copy_like_lib as lib;
10
11 struct MyType { x: i32 }
12
13 trait MyTrait { fn foo() {} }
14 impl<T: lib::MyCopy> MyTrait for T { }
15
16 // `MyFundamentalStruct` is declared fundamental, so we can test that
17 //
18 //    MyFundamentalStruct<MyTrait>: !MyTrait
19 //
20 // Huzzah.
21 impl MyTrait for lib::MyFundamentalStruct<MyType> { }
22
23
24 fn main() { }