Add test for pattern_type_mismatch.

This issue has been fixed by [commit](8c1c763c2d)
This PR is used for close #7946(Fixes #7946).

changelog: Add test for pattern_type_mismatch.
This commit is contained in:
surechen 2021-11-23 22:04:13 +08:00
parent 5fbfdfa319
commit bd63686e0f

View file

@ -37,4 +37,13 @@ fn should_not_lint() {
Some(_) => (),
_ => (),
}
const FOO: &str = "foo";
fn foo(s: &str) -> i32 {
match s {
FOO => 1,
_ => 0,
}
}
}