-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 appliedL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions

Description
Here is an example:
fn main() {
let v = vec![1, 2, 3];
{
let mut it = v.windows(2);
while let Some([x, y]) = it.next() {
println!("x: {}", x);
println!("y: {}", y);
}
}
/*
warning: this loop could be written as a `for` loop
--> src/main.rs:6:34
|
6 | while let Some([x, y]) = it.next() {
| ^^^^^^^^^ help: try: `for [x, y] in it { .. }`
|
= note: #[warn(clippy::while_let_on_iterator)] on by default
*/
// The Clippy suggestion fails to compile
/*
{
let mut it = v.windows(2);
for [x, y] in it {
println!("x: {}", x);
println!("y: {}", y);
}
}
*/
}
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 appliedL-suggestionLint: Improving, adding or fixing lint suggestionsLint: Improving, adding or fixing lint suggestions