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