You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of #54946 - estebank:iterator, r=varkor
Add filtering option to `rustc_on_unimplemented` and reword `Iterator` E0277 errors
- Add more targetting filters for arrays to `rustc_on_unimplemented` (Fix#53766)
- Detect one element array of `Range` type, which is potentially a typo:
`for _ in [0..10] {}` where iterating between `0` and `10` was intended.
(Fix#23141)
- Suggest `.bytes()` and `.chars()` for `String`.
- Suggest borrowing or `.iter()` on arrays (Fix#36391)
- Suggest using range literal when iterating on integers (Fix#34353)
- Do not suggest `.iter()` by default (Fix#50773, fix#46806)
- Add regression test (Fix#22872)
| |_^ `i32` is not an iterator; maybe try calling `.iter()` or a similar method
84
+
| |_^ `i32` is not an iterator
85
85
|
86
86
= help: the trait `std::iter::Iterator` is not implemented for `i32`
87
+
= note: if you want to iterate between `start` until a value `end`, use the exclusive range syntax `start..end` or the inclusive range syntax `start..=end`
87
88
= help: see issue #48214
88
89
= help: add #![feature(trivial_bounds)] to the crate attributes to enable
0 commit comments