#![deny(suspicious_auto_trait_impls)] use std::marker::PhantomData; struct MayImplementSendOk(T); unsafe impl Send for MayImplementSendOk {} // ok struct MayImplementSendErr(T); unsafe impl Send for MayImplementSendErr<&T> {} //~^ ERROR //~| WARNING this will change its meaning struct ContainsNonSendDirect(*const T); unsafe impl Send for ContainsNonSendDirect<&T> {} // ok struct ContainsPtr(*const T); struct ContainsIndirectNonSend(ContainsPtr); unsafe impl Send for ContainsIndirectNonSend<&T> {} // ok struct ContainsVec(Vec); unsafe impl Send for ContainsVec {} //~^ ERROR //~| WARNING this will change its meaning struct TwoParams(T, U); unsafe impl Send for TwoParams {} // ok struct TwoParamsFlipped(T, U); unsafe impl Send for TwoParamsFlipped {} // ok struct TwoParamsSame(T, U); unsafe impl Send for TwoParamsSame {} //~^ ERROR //~| WARNING this will change its meaning pub struct WithPhantomDataNonSend(PhantomData<*const T>, U); unsafe impl Send for WithPhantomDataNonSend {} // ok pub struct WithPhantomDataSend(PhantomData, U); unsafe impl Send for WithPhantomDataSend<*const T, i8> {} //~^ ERROR //~| WARNING this will change its meaning pub struct WithLifetime<'a, T>(&'a (), T); unsafe impl Send for WithLifetime<'static, T> {} // ok unsafe impl Sync for WithLifetime<'static, Vec> {} //~^ ERROR //~| WARNING this will change its meaning fn main() {}