]> git.lizzy.rs Git - rust.git/blob - src/test/ui/typeck/typeck-default-trait-impl-negation-send.rs
Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyup
[rust.git] / src / test / ui / typeck / typeck-default-trait-impl-negation-send.rs
1 #![feature(negative_impls)]
2
3 struct MySendable {
4    t: *mut u8
5 }
6
7 unsafe impl Send for MySendable {}
8
9 struct MyNotSendable {
10    t: *mut u8
11 }
12
13 impl !Send for MyNotSendable {}
14
15 fn is_send<T: Send>() {}
16
17 fn main() {
18     is_send::<MySendable>();
19     is_send::<MyNotSendable>();
20     //~^ ERROR `MyNotSendable` cannot be sent between threads safely
21 }