-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
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
The manual_is_ascii_check lint suggests an incompatible type, leading to a compilation error. The lambda requires |c: &char|, but clippy inserts |c: char| instead.
I think this is related to #11988.
Reproducer
I tried this code:
fn main() {
let digits: String = "1234ABCD"
.chars()
.take_while(|c| ('0'..='9').contains(c)) // <-- line that is changed
.collect();
println!("{digits}");
}I expected to see this happen:
- either
.take_while(|c| c.is_ascii_digit()) - or
.take_while(|c: &char| c.is_ascii_digit())
Instead, this happened:
.take_while(|c: char| c.is_ascii_digit())
Version
rustc 1.83.0 (90b35a623 2024-11-26)
binary: rustc
commit-hash: 90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf
commit-date: 2024-11-26
host: x86_64-unknown-linux-gnu
release: 1.83.0
LLVM version: 19.1.1
Additional Labels
@rustbot label I-suggestion-causes-error
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