]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence_copy_like_err_fundamental_struct.rs
Merge commit 'ea199bacef07213dbe008841b89c450e3bf0c638' into rustfmt-sync
[rust.git] / src / test / 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() { }