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