File tree Expand file tree Collapse file tree 4 files changed +4
-3
lines changed
Expand file tree Collapse file tree 4 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ unsafe_impl_trusted_step![AsciiChar char i8 i16 i32 i64 i128 isize u8 u16 u32 u6
2222/// The *predecessor* operation moves towards values that compare lesser.
2323#[ rustc_diagnostic_item = "range_step" ]
2424#[ rustc_on_unimplemented(
25+ message = "`std::ops::Range<{Self}>` is not an iterator" ,
2526 note = "`Range` only implements `Iterator` for select types in the standard library, \
2627 particularly integers; to see the full list of types, see the documentation for the \
2728 unstable `Step` trait"
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ pub fn main() {
77
88 // Bool => does not implement iterator.
99 for i in false ..true { }
10- //~^ ERROR `bool: Step ` is not satisfied
10+ //~^ ERROR `std::ops::Range<bool> ` is not an iterator
1111
1212 // Unsized type.
1313 let arr: & [ _ ] = & [ 1 , 2 , 3 ] ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ error[E0308]: mismatched types
44LL | let _ = 0u32..10i32;
55 | ^^^^^ expected `u32`, found `i32`
66
7- error[E0277]: the trait bound `bool: Step ` is not satisfied
7+ error[E0277]: `std::ops::Range<bool> ` is not an iterator
88 --> $DIR/range-1.rs:9:14
99 |
1010LL | for i in false..true {}
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ help: consider restricting type parameter `T` with unstable trait `Unstable`
1616LL | pub fn bar<T: Unstable>(t: T) {
1717 | ++++++++++
1818
19- error[E0277]: the trait bound `T: Step ` is not satisfied
19+ error[E0277]: `std::ops::Range<T> ` is not an iterator
2020 --> $DIR/unstable-trait-suggestion.rs:17:14
2121 |
2222LL | for _ in t {}
You can’t perform that action at this time.
0 commit comments