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

Potential FN with map_identity lint #7189

Closed
fanninpm opened this issue May 7, 2021 · 0 comments · Fixed by #10943
Closed

Potential FN with map_identity lint #7189

fanninpm opened this issue May 7, 2021 · 0 comments · Fixed by #10943
Labels
C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't

Comments

@fanninpm
Copy link

fanninpm commented May 7, 2021

Lint name: map_identity

I tried this code: (Originally posted by @coolreader18 in RustPython/RustPython#2627 (comment))

        self.dict
            .entries
            .next_entry(&mut self.position)
            .map(|(key, value)| (key, value))

I expected to see this happen: Clippy recognizing that this map is an identity function.

Instead, this happened: Clippy has no comment.

Meta

  • cargo clippy -V: clippy 0.1.52 (88f19c6 2021-05-03)
  • rustc -Vv:
    rustc 1.46.0-nightly (f455e46ea 2020-06-20)
    binary: rustc
    commit-hash: f455e46eae1a227d735091091144601b467e1565
    commit-date: 2020-06-20
    host: x86_64-unknown-linux-gnu
    release: 1.46.0-nightly
    LLVM version: 10.0
    
@fanninpm fanninpm added C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't labels May 7, 2021
@bors bors closed this as completed in 56c8235 Oct 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing I-false-negative Issue: The lint should have been triggered on code, but wasn't
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant