]> git.lizzy.rs Git - rust.git/blob - src/test/ui/syntax-trait-polarity.rs
Auto merge of #85556 - FabianWolff:issue-85071, r=estebank,jackh726
[rust.git] / src / test / ui / syntax-trait-polarity.rs
1 #![feature(negative_impls)]
2
3 use std::marker::Send;
4
5 struct TestType;
6
7 impl !TestType {}
8 //~^ ERROR inherent impls cannot be negative
9
10 trait TestTrait {}
11
12 unsafe impl !Send for TestType {}
13 //~^ ERROR negative impls cannot be unsafe
14 impl !TestTrait for TestType {}
15
16 struct TestType2<T>(T);
17
18 impl<T> !TestType2<T> {}
19 //~^ ERROR inherent impls cannot be negative
20
21 unsafe impl<T> !Send for TestType2<T> {}
22 //~^ ERROR negative impls cannot be unsafe
23 impl<T> !TestTrait for TestType2<T> {}
24
25 fn main() {}