diff options
| author | llogiq <bogusandre@gmail.com> | 2025-01-20 17:39:37 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-20 17:39:37 +0000 |
| commit | 8f1b4bb87a9c028391f779c83dd4cecb615bd67b (patch) | |
| tree | 559b324fb2d8beebea8d6dbb9c275288ce42ed13 /compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp | |
| parent | 2280b8a09967891b6c3d2d53a001c514954489c3 (diff) | |
| parent | 3a7f50f6d3e5f96dc130296c1a94077fb0f37bf8 (diff) | |
| download | rust-8f1b4bb87a9c028391f779c83dd4cecb615bd67b.tar.gz rust-8f1b4bb87a9c028391f779c83dd4cecb615bd67b.zip | |
New lint: `unnecessary_semicolon` (#14032)
This lint detects and removes the unnecessary semicolon after a `match` or `if` statement returning `()`. It seems to be quite a common "mistake", given the number of hits (88) we had in the Clippy sources themselves. The lint doesn't bother about loops, as `rustfmt` already removes the extra semicolon. It doesn't handle blocks either, as an extra block level, followed or not by a semicolon, is likely intentional. I propose to put the lint in `pedantic`, as putting it in `style` seems quite hazardous given the number of hits. Note: there exists a `redundant-semicolon` lint in the compiler, but it is an early lint and cannot check that the expression evaluates to `()`, so it ignores the cases we're handling here. ---- changelog: [`unnecessary_semicolon`]: new lint
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
