2020-01-09 10:56:38 +00:00
|
|
|
#![feature(negative_impls)]
|
2015-01-11 12:14:39 +00:00
|
|
|
|
|
|
|
use std::marker::Send;
|
|
|
|
|
|
|
|
struct NoSend;
|
|
|
|
impl !Send for NoSend {}
|
2014-01-22 19:03:02 +00:00
|
|
|
|
|
|
|
enum Foo {
|
2015-01-11 12:14:39 +00:00
|
|
|
A(NoSend)
|
2014-01-22 19:03:02 +00:00
|
|
|
}
|
2013-05-05 19:55:32 +00:00
|
|
|
|
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(NoSend);
|
2014-02-05 22:33:10 +00:00
|
|
|
bar(x);
|
2018-06-09 23:53:36 +00:00
|
|
|
//~^ ERROR `NoSend` cannot be sent between threads safely
|
2013-05-05 19:55:32 +00:00
|
|
|
}
|