2020-01-09 05:56:38 -05:00
|
|
|
#![feature(negative_impls)]
|
2014-01-22 14:03:02 -05:00
|
|
|
|
2015-01-11 13:14:39 +01:00
|
|
|
use std::marker::Sync;
|
|
|
|
|
|
|
|
struct Foo { a: isize }
|
|
|
|
impl !Sync for Foo {}
|
2013-05-05 15:55:32 -04:00
|
|
|
|
2014-08-05 16:40:04 -07:00
|
|
|
fn bar<T: Sync>(_: 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-02-10 21:01:49 -08:00
|
|
|
//~^ ERROR `Foo` cannot be shared between threads safely [E0277]
|
2013-05-05 15:55:32 -04:00
|
|
|
}
|