2015-01-11 13:14:39 +01:00
|
|
|
#![feature(optin_builtin_traits)]
|
|
|
|
|
|
|
|
use std::marker::Send;
|
2014-01-22 14:03:02 -05:00
|
|
|
|
|
|
|
struct Foo {
|
2015-01-08 21:54:35 +11:00
|
|
|
a: isize,
|
2014-01-22 14:03:02 -05:00
|
|
|
}
|
2013-05-05 15:55:32 -04:00
|
|
|
|
2015-01-11 13:14:39 +01:00
|
|
|
impl !Send for Foo {}
|
|
|
|
|
2013-06-05 17:56:24 -07:00
|
|
|
fn bar<T: Send>(_: T) {}
|
2013-05-05 15:55:32 -04:00
|
|
|
|
|
|
|
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);
|
2018-06-09 16:53:36 -07:00
|
|
|
//~^ ERROR `Foo` cannot be sent between threads safely
|
2013-05-05 15:55:32 -04:00
|
|
|
}
|