Skip to content

Commit e3ab71e

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 e3ab71e

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
@@ -15,6 +15,15 @@ fn should_lint() {
1515
Some(_) => (),
1616
_ => (),
1717
}
18+
19+
const FOO: &str = "foo";
20+
21+
fn foo(s: &str) -> i32 {
22+
match s {
23+
FOO => 1,
24+
_ => 0,
25+
}
26+
}
1827
}
1928

2029
fn should_not_lint() {

0 commit comments

Comments
 (0)