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