From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../coherence/coherence-negative-outlives-lifetimes.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/ui/coherence/coherence-negative-outlives-lifetimes.rs (limited to 'tests/ui/coherence/coherence-negative-outlives-lifetimes.rs') diff --git a/tests/ui/coherence/coherence-negative-outlives-lifetimes.rs b/tests/ui/coherence/coherence-negative-outlives-lifetimes.rs new file mode 100644 index 000000000..3acf0d8d3 --- /dev/null +++ b/tests/ui/coherence/coherence-negative-outlives-lifetimes.rs @@ -0,0 +1,17 @@ +// revisions: stock with_negative_coherence +//[with_negative_coherence] check-pass + +#![feature(negative_impls)] +#![cfg_attr(with_negative_coherence, feature(with_negative_coherence))] + +trait MyPredicate<'a> {} + +impl<'a, T> !MyPredicate<'a> for &'a T where T: 'a {} + +trait MyTrait<'a> {} + +impl<'a, T: MyPredicate<'a>> MyTrait<'a> for T {} +impl<'a, T> MyTrait<'a> for &'a T {} +//[stock]~^ ERROR: conflicting implementations of trait `MyTrait<'_>` for type `&_` + +fn main() {} -- cgit v1.2.3