]> git.lizzy.rs Git - rust.git/blob - src/test/ui/syntax-trait-polarity.rs
Rollup merge of #57132 - daxpedda:master, r=steveklabnik
[rust.git] / src / test / ui / syntax-trait-polarity.rs
1 #![feature(optin_builtin_traits)]
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 //~^ ERROR negative impls are only allowed for auto traits
16
17 struct TestType2<T>(T);
18
19 impl<T> !TestType2<T> {}
20 //~^ ERROR inherent impls cannot be negative
21
22 unsafe impl<T> !Send for TestType2<T> {}
23 //~^ ERROR negative impls cannot be unsafe
24 impl<T> !TestTrait for TestType2<T> {}
25 //~^ ERROR negative impls are only allowed for auto traits
26
27 fn main() {}