Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking issue for Rust clippy same_item_push false positives #223

Closed
bgurney-rh opened this issue Sep 2, 2020 · 0 comments · Fixed by stratis-storage/devicemapper-rs#579
Assignees

Comments

@bgurney-rh
Copy link
Member

While going through the Rust 1.46 release steps, there was a clippy lint for same_item_push that falsely triggered in devicemapper-rs

"rustup default beta" (rustc 1.47.0-beta.1)

error: it looks like the same item is being pushed into this Vec
   --> src/core/dm.rs:582:17
    |
582 |                 targets.push((targ.sector_start, targ.length, target_type, params));
    |                 ^^^^^^^
    |
    = note: `-D clippy::same-item-push` implied by `-D warnings`
    = help: try using vec![(targ.sector_start, targ.length, target_type, params);SIZE] or targets.resize(NEW_SIZE, (targ.sector_start, targ.length, target_type, params))
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push

The original issue was filed on August 13, 2020:
same_item_push lint can trigger when the pushed value is not constant: rust-lang/rust-clippy#5902

However, there's a couple new issues related to same_item_push:

"same_item_push is incorrect in several cases": rust-lang/rust-clippy#5985

"same_item_push being suggested for values that are not Copy or Clone": rust-lang/rust-clippy#5979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants