1 #![feature(negative_impls)]
4 impl !Send for Managed {}
5 impl !Sync for Managed {}
7 use std::cell::UnsafeCell;
13 unsafe impl Sync for MySync {}
19 impl !Sync for MyNotSync {}
21 struct MyTypeWUnsafe {
25 struct MyTypeManaged {
29 fn is_sync<T: Sync>() {}
33 is_sync::<MyNotSync>();
34 //~^ ERROR `MyNotSync` cannot be shared between threads safely [E0277]
36 is_sync::<MyTypeWUnsafe>();
37 //~^ ERROR `UnsafeCell<u8>` cannot be shared between threads safely [E0277]
39 is_sync::<MyTypeManaged>();
40 //~^ ERROR `Managed` cannot be shared between threads safely [E0277]