about summary refs log tree commit diff
path: root/tests/ui/structs/struct-variant-privacy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/structs/struct-variant-privacy.rs')
-rw-r--r--tests/ui/structs/struct-variant-privacy.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/structs/struct-variant-privacy.rs b/tests/ui/structs/struct-variant-privacy.rs
new file mode 100644
index 00000000000..fcdf9a22baf
--- /dev/null
+++ b/tests/ui/structs/struct-variant-privacy.rs
@@ -0,0 +1,14 @@
+mod foo {
+    enum Bar {
+        Baz { a: isize },
+    }
+}
+
+fn f(b: foo::Bar) {
+    //~^ ERROR enum `Bar` is private
+    match b {
+        foo::Bar::Baz { a: _a } => {} //~ ERROR enum `Bar` is private
+    }
+}
+
+fn main() {}