]> git.lizzy.rs Git - rust.git/blob - tests/ui/coherence/coherence-negative-outlives-lifetimes.rs
Auto merge of #106853 - TimNN:undo-remap, r=oli-obk
[rust.git] / tests / ui / coherence / coherence-negative-outlives-lifetimes.rs
1 // revisions: stock with_negative_coherence
2 //[with_negative_coherence] check-pass
3
4 #![feature(negative_impls)]
5 #![cfg_attr(with_negative_coherence, feature(with_negative_coherence))]
6
7 trait MyPredicate<'a> {}
8
9 impl<'a, T> !MyPredicate<'a> for &'a T where T: 'a {}
10
11 trait MyTrait<'a> {}
12
13 impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {}
14 impl<'a, T> MyTrait<'a> for &'a T {}
15 //[stock]~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_`
16
17 fn main() {}