-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have
Description
Lint name: repeat_once
I tried this code:
fn main() {
const REPEAT_COUNT: usize = 1;
"x".repeat(REPEAT_COUNT);
}
I expected to see this happen: the lint is not triggered because if I used a constant as a parameter I probably intend to allow changing the constant value to something else in the future.
Instead, this happened: the lint triggers
Meta
cargo clippy -V
: clippy 0.1.54 (1c6868a 2021-05-27rustc -Vv
:rustc 1.54.0-nightly (1c6868aa2 2021-05-27) binary: rustc commit-hash: 1c6868aa21981b37cbd3fc95828ee3b0ac22d494 commit-date: 2021-05-27 host: x86_64-unknown-linux-gnu release: 1.54.0-nightly LLVM version: 12.0.1
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-positiveIssue: The lint was triggered on code it shouldn't haveIssue: The lint was triggered on code it shouldn't have