diff options
| author | bors <bors@rust-lang.org> | 2024-03-09 20:15:02 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-09 20:15:02 +0000 |
| commit | d8a9068e8369a6ef454581b5f07d2caadfc62109 (patch) | |
| tree | 55541e2fbd884eb2f7d100883970695ceeb35ecc /compiler/rustc_codegen_gcc/example/std_example.rs | |
| parent | c173ea64b7c3ff289098569de04217e34454c59f (diff) | |
| parent | 0c82fd01c7968e09c233abbf9b7728ccea230f49 (diff) | |
| download | rust-d8a9068e8369a6ef454581b5f07d2caadfc62109.tar.gz rust-d8a9068e8369a6ef454581b5f07d2caadfc62109.zip | |
Auto merge of #12449 - Jacherr:issue-6439, r=llogiq
Add new lint `zero_repeat_side_effects` Fixes https://github.com/rust-lang/rust-clippy/issues/6439 Adds a new `suspicious` lint zero_repeat_side_effects. This lint warns the user when initializing an array or `Vec` using the `Repeat` syntax, i.e., `[x; y]`. If `x` is an `Expr::Call/MethodCall` or contains an `Expr::Call/MethodCall` and `y` is zero, then there is a chance that the internal call can produce side effects, such as printing to console, which is not very obvious. This lint warns against this and instead suggests to separate out the function call and the array/Vec initialization. changelog: Add new lint `zero_repeat_side_effects`
Diffstat (limited to 'compiler/rustc_codegen_gcc/example/std_example.rs')
0 files changed, 0 insertions, 0 deletions
