about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-12-01 09:58:54 +0000
committerbors <bors@rust-lang.org>2021-12-01 09:58:54 +0000
commit8ad56c8fb72e38ff991d932da6a0acf91c0128ba (patch)
treec48ebc95fe5d9c8e7cd297e2c9742a494c1aa8ef
parentecf931f5ac37b14df1a2949141d2042c4b0407f3 (diff)
parentbd63686e0f848c40bbfd6dc9ddac7f45f5e77f54 (diff)
downloadrust-8ad56c8fb72e38ff991d932da6a0acf91c0128ba.tar.gz
rust-8ad56c8fb72e38ff991d932da6a0acf91c0128ba.zip
Auto merge of #8049 - surechen:fixes_7946, r=flip1995
Add test for pattern_type_mismatch.

This issue has been fixed by [commit](https://github.com/rust-lang/rust-clippy/commit/8c1c763c2d5897c66f52bd5e7c16f48ae66c894c)
This PR is used for close #7946(Fixes #7946).

changelog: Add test for pattern_type_mismatch.
-rw-r--r--tests/ui/pattern_type_mismatch/mutability.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/pattern_type_mismatch/mutability.rs b/tests/ui/pattern_type_mismatch/mutability.rs
index 9b4f2f1f579..55a8c26215e 100644
--- a/tests/ui/pattern_type_mismatch/mutability.rs
+++ b/tests/ui/pattern_type_mismatch/mutability.rs
@@ -37,4 +37,13 @@ fn should_not_lint() {
         Some(_) => (),
         _ => (),
     }
+
+    const FOO: &str = "foo";
+
+    fn foo(s: &str) -> i32 {
+        match s {
+            FOO => 1,
+            _ => 0,
+        }
+    }
 }