2024-02-16 20:02:50 +00:00
|
|
|
//@ compile-flags:-Ztranslate-lang=en_US
|
2023-02-23 01:01:50 +01:00
|
|
|
|
|
|
|
|
#![feature(negative_impls)]
|
|
|
|
|
#![feature(marker_trait_attr)]
|
|
|
|
|
|
|
|
|
|
#[marker]
|
|
|
|
|
trait MyTrait {}
|
|
|
|
|
|
|
|
|
|
struct TestType<T>(::std::marker::PhantomData<T>);
|
|
|
|
|
|
|
|
|
|
unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
|
|
|
|
|
|
2025-02-28 01:28:32 +00:00
|
|
|
impl<T: MyTrait> !Send for TestType<T> {}
|
|
|
|
|
//~^ ERROR found both positive and negative implementation
|
|
|
|
|
//~| ERROR `!Send` impl requires `T: MyTrait` but the struct it is implemented for does not
|
2023-02-23 01:01:50 +01:00
|
|
|
|
|
|
|
|
unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations
|
|
|
|
|
|
|
|
|
|
impl !Send for TestType<i32> {}
|
2025-02-28 01:28:32 +00:00
|
|
|
//~^ ERROR `!Send` impls cannot be specialized
|
2023-02-23 01:01:50 +01:00
|
|
|
|
|
|
|
|
fn main() {}
|