2022-08-20 03:23:23 +00:00
|
|
|
// revisions: stock with_negative_coherence
|
2022-08-22 15:52:49 -03:00
|
|
|
//[with_negative_coherence] check-pass
|
|
|
|
|
2022-02-10 11:55:23 -03:00
|
|
|
#![feature(negative_impls)]
|
2022-08-20 03:23:23 +00:00
|
|
|
#![cfg_attr(with_negative_coherence, feature(with_negative_coherence))]
|
2022-02-10 11:55:23 -03:00
|
|
|
|
|
|
|
trait MyPredicate<'a> {}
|
2022-08-20 03:23:23 +00:00
|
|
|
|
|
|
|
impl<'a, T> !MyPredicate<'a> for &'a T where T: 'a {}
|
|
|
|
|
2022-02-10 11:55:23 -03:00
|
|
|
trait MyTrait<'a> {}
|
2022-08-20 03:23:23 +00:00
|
|
|
|
2022-02-10 11:55:23 -03:00
|
|
|
impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {}
|
|
|
|
impl<'a, T> MyTrait<'a> for &'a T {}
|
2022-08-22 15:52:49 -03:00
|
|
|
//[stock]~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_`
|
2022-02-10 11:55:23 -03:00
|
|
|
|
|
|
|
fn main() {}
|