diff options
| author | surechen <chenshuo17@huawei.com> | 2021-11-23 22:04:13 +0800 |
|---|---|---|
| committer | surechen <chenshuo17@huawei.com> | 2021-12-01 17:37:50 +0800 |
| commit | bd63686e0f848c40bbfd6dc9ddac7f45f5e77f54 (patch) | |
| tree | 0750aaf3af10d039921239876cbea25f7f70dcb2 | |
| parent | 5fbfdfa3199fd803a91002960ee1bac9619ac6a2 (diff) | |
| download | rust-bd63686e0f848c40bbfd6dc9ddac7f45f5e77f54.tar.gz rust-bd63686e0f848c40bbfd6dc9ddac7f45f5e77f54.zip | |
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.rs | 9 |
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, + } + } } |
