]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence_copy_like_err_struct.rs
Merge commit 'f51aade56f93175dde89177a92e3669ebd8e7592' into clippyup
[rust.git] / src / test / ui / coherence / coherence_copy_like_err_struct.rs
1 // aux-build:coherence_copy_like_lib.rs
2
3 // Test that we are able to introduce a negative constraint that
4 // `MyType: !MyTrait` along with other "fundamental" wrappers.
5
6 extern crate coherence_copy_like_lib as lib;
7
8 struct MyType { x: i32 }
9
10 trait MyTrait { fn foo() {} }
11 impl<T: lib::MyCopy> MyTrait for T { }
12
13 // `MyStruct` is not declared fundamental, therefore this would
14 // require that
15 //
16 //     MyStruct<MyType>: !MyTrait
17 //
18 // which we cannot approve.
19 impl MyTrait for lib::MyStruct<MyType> { }
20 //~^ ERROR E0119
21
22 fn main() { }