Skip to content

Commit bd63686

Browse files
committed
Add test for pattern_type_mismatch.
This issue has been fixed by [commit](8c1c763) This PR is used for close #7946(Fixes #7946). changelog: Add test for pattern_type_mismatch.
1 parent 5fbfdfa commit bd63686

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/ui/pattern_type_mismatch/mutability.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,13 @@ fn should_not_lint() {
3737
Some(_) => (),
3838
_ => (),
3939
}
40+
41+
const FOO: &str = "foo";
42+
43+
fn foo(s: &str) -> i32 {
44+
match s {
45+
FOO => 1,
46+
_ => 0,
47+
}
48+
}
4049
}

0 commit comments

Comments
 (0)