Skip to content

Commit

Permalink
Add test for pattern_type_mismatch.
Browse files Browse the repository at this point in the history
This issue has been fixed by [commit](rust-lang/rust-clippy@8c1c763)
This PR is used for close rust-lang#7946(Fixes rust-lang#7946).

changelog: Add test for pattern_type_mismatch.
  • Loading branch information
surechen committed Dec 1, 2021
1 parent 5fbfdfa commit bd63686
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/ui/pattern_type_mismatch/mutability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,13 @@ fn should_not_lint() {
Some(_) => (),
_ => (),
}

const FOO: &str = "foo";

fn foo(s: &str) -> i32 {
match s {
FOO => 1,
_ => 0,
}
}
}

0 comments on commit bd63686

Please sign in to comment.