os-rust/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs

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

13 lines
335 B
Rust
Raw Normal View History

2022-02-10 11:55:23 -03:00
#![feature(negative_impls)]
// FIXME: this should compile
trait MyPredicate<'a> {}
impl<'a, T> !MyPredicate<'a> for &T where T: 'a {}
trait MyTrait<'a> {}
impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {}
impl<'a, T> MyTrait<'a> for &'a T {}
//~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_`
fn main() {}