]> git.lizzy.rs Git - rust.git/blob - src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs
Rollup merge of #104467 - fuzzypixelz:fix/attempt-to-substract-with-overflow, r=compi...
[rust.git] / src / test / 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() {}