Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#12549 - granddaifuku:fix/suspicious_else_form…
…atting-false-positive-when-commented-else, r=Alexendoo fix: `suspicious_else_formatting` false positive when else is included … This PR addresses an issue where invalid suggestions are generated for `if-else` formatting if comments contain the keyword `else`. The root of the problem is identified [here](https://github.com/rust-lang/rust-clippy/blob/95c62ffae9bbce793f68a6f1473e3fc24af19bdd/clippy_lints/src/formatting.rs#L217). Specifically, when a comment contains the word `else`, the lint mistakenly interprets it as part of an `if-else` clause. This misinterpretation leads to an incorrect splitting of the snippet, resulting in erroneous suggestions. fixes: rust-lang#12497 changelog: [`suspicious_else_formatting`]: Fixes invalid suggestions when comments include word else
- Loading branch information