2020-01-09 10:56:38 +00:00
|
|
|
#![feature(negative_impls)]
|
2015-01-11 12:14:39 +00:00
|
|
|
|
|
|
|
use std::marker::Send;
|
2014-01-22 19:03:02 +00:00
|
|
|
|
|
|
|
struct Foo {
|
2015-01-08 10:54:35 +00:00
|
|
|
a: isize,
|
2014-01-22 19:03:02 +00:00
|
|
|
}
|
2013-05-05 19:55:32 +00:00
|
|
|
|
2015-01-11 12:14:39 +00:00
|
|
|
impl !Send for Foo {}
|
|
|
|
|
2013-06-06 00:56:24 +00:00
|
|
|
fn bar<T: Send>(_: T) {}
|
2013-05-05 19:55:32 +00:00
|
|
|
|
|
|
|
fn main() {
|
2015-01-11 12:14:39 +00:00
|
|
|
let x = Foo { a: 5 };
|
2014-02-05 22:33:10 +00:00
|
|
|
bar(x);
|
2018-06-09 23:53:36 +00:00
|
|
|
//~^ ERROR `Foo` cannot be sent between threads safely
|
2013-05-05 19:55:32 +00:00
|
|
|
}
|