about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2022-03-17 11:26:45 -0300
committerSantiago Pastorino <spastorino@gmail.com>2022-03-17 12:15:11 -0300
commit64dfd3b2340a42f5fda5802d50c9739d38533102 (patch)
treeaf400c4c1e7bb7983e39dfbc999c7e9f2ad07d55 /src
parent78346489c66779d024c60af2d2f0f5d9d455f688 (diff)
downloadrust-64dfd3b2340a42f5fda5802d50c9739d38533102.tar.gz
rust-64dfd3b2340a42f5fda5802d50c9739d38533102.zip
Make negative coherence work when there's impl negative on super predicates
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/coherence/coherence-overlap-super-negative.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/test/ui/coherence/coherence-overlap-super-negative.rs b/src/test/ui/coherence/coherence-overlap-super-negative.rs
new file mode 100644
index 00000000000..d296a094a37
--- /dev/null
+++ b/src/test/ui/coherence/coherence-overlap-super-negative.rs
@@ -0,0 +1,18 @@
+// check-pass
+
+#![feature(negative_impls)]
+#![feature(rustc_attrs)]
+#![feature(with_negative_coherence)]
+
+trait Trait1: Trait2 {}
+trait Trait2 {}
+
+struct MyType {}
+impl !Trait2 for MyType {}
+
+#[rustc_strict_coherence]
+trait Foo {}
+impl<T: Trait1> Foo for T {}
+impl Foo for MyType {}
+
+fn main() {}