]> git.proxmox.com Git - rustc.git/blob - tests/ui/coherence/coherence_copy_like_err_tuple.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / coherence / coherence_copy_like_err_tuple.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
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 // Tuples are not fundamental, therefore this would require that
14 //
15 // (MyType,): !MyTrait
16 //
17 // which we cannot approve.
18 impl MyTrait for (MyType,) { }
19 //~^ ERROR E0119
20
21 fn main() { }