-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
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
Summary
This is very similar to #11124, I'm not sure if it's a regression or if the issue should never have been closed. There is also a comment on that issue about the issue persisting. If a tuple or array is destructured, and the individual entries are used in other ways than just constructing the array/tuple respectively, then the lint should not trigger.
Lint Name
tuple_array_conversions
Reproducer
The example in that #11124 still triggers the lint, but here is a simplified example (playground) closer to how I encountered the false positive.
#![warn(clippy::tuple_array_conversions)]
fn do_something(tuple: (u32, u32)) {
println!("{tuple:?}")
}
fn produce_array() -> [u32; 2] {
[1, 2]
}
fn main() {
let [a, b] = produce_array();
for tuple in [(a, b), (b, a)] {
do_something(tuple);
}
}Version
rustc 1.91.1 (ed61e7d7e 2025-11-07)
binary: rustc
commit-hash: ed61e7d7e242494fb7057f2657300d9e77bb4fcb
commit-date: 2025-11-07
host: x86_64-unknown-linux-gnu
release: 1.91.1
LLVM version: 21.1.2
(Also triggers on playground.)
Additional Labels
No response
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