Skip to content

iter_kv_map needs to be MSRV gated on 1.54 #11752

Closed
@apoelstra

Description

@apoelstra

Summary

The new iter_kv_map lint triggers even when clippy.toml MSRV is set before the into_keys method exists.

Reproducer

cargo new clippy-demo
echo 'msrv = "1.48.0"' > clippy.toml
echo 'use std::collections::HashMap; fn main() { let x = HashMap::<(), ()>::new(); x.into_iter().map(|(k, _)| k); }' > src/main.rs
cargo clippy

You will get a suggestion to use into_keys rather than into_iter().map. But into_keys is not available until Rust 1.54.

Version

rustc 1.73.0 (cc66ad468 2023-10-03)
binary: rustc
commit-hash: cc66ad468955717ab92600c770da8c1601a4ff33
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
release: 1.73.0
LLVM version: 17.0.2

Additional Labels

No response

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions