-
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-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied
Description
Summary
When the receiver with the useless .into_iter() is enclosed in parens, the suggestion eats the closing paren
Reproducer
I tried this code:
#![warn(clippy::useless_conversion)]
#![allow(unused)]
fn main() {
fn f(_: impl IntoIterator<Item = i32>){}
f((vec![]).into_iter())
}I expected to see this happen:
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> src/main.rs:8:7
|
6 | f((vec![]).into_iter())
| ^^^^^^^^------------
| |
| help: consider removing the `.into_iter()`
|
Instead, this happened:
warning: explicit call to `.into_iter()` in function argument accepting `IntoIterator`
--> src/main.rs:8:7
|
6 | f((vec![]).into_iter())
| ^^^^^^^-------------
| |
| help: consider removing the `.into_iter()`
|
Version
rustc 1.91.0 (f8297e351 2025-10-28)
binary: rustc
commit-hash: f8297e351a40c1439a467bbbb6879088047f50b3
commit-date: 2025-10-28
host: x86_64-unknown-linux-gnu
release: 1.91.0
LLVM version: 21.1.2
Additional Labels
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedIssue: The suggestions provided by this Lint cause an ICE/error when applied