]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence_copy_like_err_fundamental_struct_ref.rs
Rollup merge of #104467 - fuzzypixelz:fix/attempt-to-substract-with-overflow, r=compi...
[rust.git] / src / test / ui / coherence / coherence_copy_like_err_fundamental_struct_ref.rs
1 // Test that we are able to introduce a negative constraint that
2 // `MyType: !MyTrait` along with other "fundamental" wrappers.
3
4 // check-pass
5 // aux-build:coherence_copy_like_lib.rs
6
7 extern crate coherence_copy_like_lib as lib;
8
9 struct MyType { x: i32 }
10
11 trait MyTrait { fn foo() {} }
12 impl<T: lib::MyCopy> MyTrait for T { }
13
14 // `MyFundamentalStruct` is declared fundamental, so we can test that
15 //
16 //    MyFundamentalStruct<&MyTrait>: !MyTrait
17 //
18 // Huzzah.
19 impl<'a> MyTrait for lib::MyFundamentalStruct<&'a MyType> { }
20
21 fn main() { }