summaryrefslogtreecommitdiffstats
path: root/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs')
-rw-r--r--src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs
new file mode 100644
index 000000000..159788b1b
--- /dev/null
+++ b/src/test/ui/coherence/coherence-negative-outlives-lifetimes.rs
@@ -0,0 +1,12 @@
+#![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() {}