rust/src/test/ui/no_send-struct.rs

18 lines
249 B
Rust
Raw Normal View History

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