From bd63686e0f848c40bbfd6dc9ddac7f45f5e77f54 Mon Sep 17 00:00:00 2001 From: surechen Date: Tue, 23 Nov 2021 22:04:13 +0800 Subject: [PATCH] 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. --- tests/ui/pattern_type_mismatch/mutability.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/ui/pattern_type_mismatch/mutability.rs b/tests/ui/pattern_type_mismatch/mutability.rs index 9b4f2f1f57934..55a8c26215e9e 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, + } + } }