summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/typeck-default-trait-impl-negation-send.rs
blob: 3a2fc39d409d9b4b9b4d61459b0d9326daa414d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#![feature(negative_impls)]

struct MySendable {
   t: *mut u8
}

unsafe impl Send for MySendable {}

struct MyNotSendable {
   t: *mut u8
}

impl !Send for MyNotSendable {}

fn is_send<T: Send>() {}

fn main() {
    is_send::<MySendable>();
    is_send::<MyNotSendable>();
    //~^ ERROR `MyNotSendable` cannot be sent between threads safely
}