about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/errors.rs
diff options
context:
space:
mode:
authorAlex Macleod <alex@macleod.io>2025-03-18 12:45:19 +0000
committerGitHub <noreply@github.com>2025-03-18 12:45:19 +0000
commitd443f38f73bd35dd9684fa6817985db6d465a9c1 (patch)
treebd9541e0d5b02cfcf97eda495fa0121a5f5c5275 /compiler/rustc_pattern_analysis/src/errors.rs
parentea30a09fe1643faedac71e2c2c56d2b1152644a8 (diff)
parenta1bdc191ba5c3976d7f1d09d894a8c41760166fb (diff)
downloadrust-d443f38f73bd35dd9684fa6817985db6d465a9c1.tar.gz
rust-d443f38f73bd35dd9684fa6817985db6d465a9c1.zip
Reinstate `single_match`/`single_match_else` lints with comments (#14420)
Commit efe3fe9b8c5f16bbf39af7415bbde9441bc54dbb removed the ability for
`single_match` and `single_match_else` to trigger if comments were
present outside of the arms, as those comments would be lost while
rewriting the `match` expression.

This reinstates the lint, but prevents the suggestion from being applied
automatically in the presence of comments by using the `MaybeIncorrect`
applicability. Also, a note is added to the lint message to warn the
user about the need to preserve the comments if acting upon the
suggestion.

changelog: [`single_match`, `single_match_else`]: reinstate lint when
comments are inside the `match` but do not autofix the code

Fix #14418
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/errors.rs')
0 files changed, 0 insertions, 0 deletions