]> git.proxmox.com Git - rustc.git/blame - src/test/ui/typeck/typeck-default-trait-impl-negation-send.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / typeck / typeck-default-trait-impl-negation-send.rs
CommitLineData
ba9703b0 1#![feature(negative_impls)]
223e47cc 2
c34b1796
AL
3struct MySendable {
4 t: *mut u8
5}
1a4d82fc 6
c34b1796 7unsafe impl Send for MySendable {}
223e47cc 8
c34b1796
AL
9struct MyNotSendable {
10 t: *mut u8
11}
12
13impl !Send for MyNotSendable {}
14
15fn is_send<T: Send>() {}
16
17fn main() {
18 is_send::<MySendable>();
19 is_send::<MyNotSendable>();
8faf50e0 20 //~^ ERROR `MyNotSendable` cannot be sent between threads safely
c34b1796 21}