Files
rust/src/test/ui/no_send-enum.rs

19 lines
270 B
Rust
Raw Normal View History

2015-01-11 13:14:39 +01:00
#![feature(optin_builtin_traits)]
use std::marker::Send;
struct NoSend;
impl !Send for NoSend {}
enum Foo {
2015-01-11 13:14:39 +01:00
A(NoSend)
}
fn bar<T: Send>(_: T) {}
fn main() {
2015-01-11 13:14:39 +01:00
let x = Foo::A(NoSend);
2014-02-05 16:33:10 -06:00
bar(x);
//~^ ERROR `NoSend` cannot be sent between threads safely
}