summaryrefslogtreecommitdiffstats
path: root/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/consts/const_in_pattern/cross-crate-fail.rs')
-rw-r--r--src/test/ui/consts/const_in_pattern/cross-crate-fail.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs b/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs
new file mode 100644
index 000000000..ab297f54d
--- /dev/null
+++ b/src/test/ui/consts/const_in_pattern/cross-crate-fail.rs
@@ -0,0 +1,25 @@
+// aux-build:consts.rs
+
+#![warn(indirect_structural_match)]
+
+extern crate consts;
+
+struct Defaulted;
+impl consts::AssocConst for Defaulted {}
+
+fn main() {
+ let _ = Defaulted;
+ match None {
+ consts::SOME => panic!(),
+ //~^ must be annotated with `#[derive(PartialEq, Eq)]`
+
+ _ => {}
+ }
+
+ match None {
+ <Defaulted as consts::AssocConst>::SOME => panic!(),
+ //~^ must be annotated with `#[derive(PartialEq, Eq)]`
+
+ _ => {}
+ }
+}