]> git.proxmox.com Git - rustc.git/blame - src/test/ui/no_send-enum.rs
New upstream version 1.44.1+dfsg1
[rustc.git] / src / test / ui / no_send-enum.rs
CommitLineData
ba9703b0 1#![feature(negative_impls)]
85aaf69f
SL
2
3use std::marker::Send;
4
5struct NoSend;
6impl !Send for NoSend {}
1a4d82fc
JJ
7
8enum Foo {
85aaf69f 9 A(NoSend)
1a4d82fc 10}
970d7e83
LB
11
12fn bar<T: Send>(_: T) {}
223e47cc
LB
13
14fn main() {
85aaf69f 15 let x = Foo::A(NoSend);
1a4d82fc 16 bar(x);
8faf50e0 17 //~^ ERROR `NoSend` cannot be sent between threads safely
223e47cc 18}