Commit 70c46de
committed
Auto merge of rust-lang#5877 - ebroto:5872_loops_ice, r=Manishearth
Fix ICE in `loops` module
changelog: Fix ICE related to `needless_collect` when a call to `iter()` was not present.
I went for restoring the old suggestion of `next().is_some()` over `get(0).is_some()` given that `iter()` is not necessarily present (could be e.g. `into_iter()` or `iter_mut()`) and that the old suggestion could change semantics, e.g. a call to `filter()` could be present between `iter()` and the collect part.
Fixes rust-lang#5872File tree
6 files changed
+30
-15
lines changed- clippy_lints/src
- tests/ui
- crashes
6 files changed
+30
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2374 | 2374 | | |
2375 | 2375 | | |
2376 | 2376 | | |
2377 | | - | |
| 2377 | + | |
2378 | 2378 | | |
2379 | 2379 | | |
2380 | 2380 | | |
| |||
2386 | 2386 | | |
2387 | 2387 | | |
2388 | 2388 | | |
2389 | | - | |
| 2389 | + | |
2390 | 2390 | | |
2391 | 2391 | | |
2392 | 2392 | | |
2393 | 2393 | | |
2394 | 2394 | | |
2395 | 2395 | | |
2396 | | - | |
| 2396 | + | |
2397 | 2397 | | |
2398 | 2398 | | |
2399 | 2399 | | |
2400 | 2400 | | |
2401 | 2401 | | |
2402 | | - | |
| 2402 | + | |
2403 | 2403 | | |
2404 | 2404 | | |
2405 | 2405 | | |
| |||
2579 | 2579 | | |
2580 | 2580 | | |
2581 | 2581 | | |
2582 | | - | |
2583 | | - | |
2584 | | - | |
2585 | | - | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
2586 | 2587 | | |
2587 | 2588 | | |
2588 | | - | |
2589 | 2589 | | |
2590 | | - | |
| 2590 | + | |
2591 | 2591 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments