rust/tests/ui/coherence/coherence-conflicting-negative-trait-impl.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
488 B
Rust
Raw Normal View History

#![feature(negative_impls)]
#![feature(marker_trait_attr)]
#[marker]
2015-04-17 22:12:20 -07:00
trait MyTrait {}
struct TestType<T>(::std::marker::PhantomData<T>);
2015-01-13 20:21:19 +01:00
unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
2015-01-13 20:21:19 +01:00
impl<T: MyTrait> !Send for TestType<T> {} //~ ERROR found both positive and negative implementation
unsafe impl<T: 'static> Send for TestType<T> {} //~ ERROR conflicting implementations
2015-01-13 20:21:19 +01:00
impl !Send for TestType<i32> {}
2023-03-06 21:05:35 +08:00
//~^ WARNING
//~| WARNING this will change its meaning
fn main() {}