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-18 05:12:20 +00:00
trait MyTrait {}
struct TestType<T>(::std::marker::PhantomData<T>);
2015-01-13 19:21:19 +00:00
unsafe impl<T: MyTrait + 'static> Send for TestType<T> {}
2015-01-13 19:21:19 +00: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 19:21:19 +00:00
impl !Send for TestType<i32> {}
2023-03-06 13:05:35 +00:00
//~^ WARNING
//~| WARNING this will change its meaning
fn main() {}