#![feature(negative_impls)] struct Managed; impl !Send for Managed {} impl !Sync for Managed {} use std::cell::UnsafeCell; struct MySync { t: *mut u8 } unsafe impl Sync for MySync {} struct MyNotSync { t: *mut u8 } impl !Sync for MyNotSync {} struct MyTypeWUnsafe { t: UnsafeCell } struct MyTypeManaged { t: Managed } fn is_sync() {} fn main() { is_sync::(); is_sync::(); //~^ ERROR `MyNotSync` cannot be shared between threads safely [E0277] is_sync::(); //~^ ERROR `UnsafeCell` cannot be shared between threads safely [E0277] is_sync::(); //~^ ERROR `Managed` cannot be shared between threads safely [E0277] }