about summary refs log tree commit diff
path: root/tests/ui/lint/lint-match-arms.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/lint/lint-match-arms.rs')
-rw-r--r--tests/ui/lint/lint-match-arms.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/lint/lint-match-arms.rs b/tests/ui/lint/lint-match-arms.rs
new file mode 100644
index 00000000000..5c2ccc60e1f
--- /dev/null
+++ b/tests/ui/lint/lint-match-arms.rs
@@ -0,0 +1,18 @@
+fn deny_on_arm() {
+    match 0 {
+        #[deny(unused_variables)]
+        //~^ NOTE the lint level is defined here
+        y => (),
+        //~^ ERROR unused variable
+    }
+}
+
+#[deny(unused_variables)]
+fn allow_on_arm() {
+    match 0 {
+        #[allow(unused_variables)]
+        y => (), // OK
+    }
+}
+
+fn main() {}