rust/src/test/ui/no_send-enum.rs
2018-12-25 21:08:33 -07:00

19 lines
270 B
Rust

#![feature(optin_builtin_traits)]
use std::marker::Send;
struct NoSend;
impl !Send for NoSend {}
enum Foo {
A(NoSend)
}
fn bar<T: Send>(_: T) {}
fn main() {
let x = Foo::A(NoSend);
bar(x);
//~^ ERROR `NoSend` cannot be sent between threads safely
}