Mention the type in the label, to avoid confusion at the cost of redundancy

This commit is contained in:
Esteban Küber 2026-01-13 16:59:03 +00:00
parent 27e09ce0be
commit 1fe705ca70
4 changed files with 4 additions and 4 deletions

View file

@ -23,7 +23,7 @@ unsafe_impl_trusted_step![AsciiChar char i8 i16 i32 i64 i128 isize u8 u16 u32 u6
#[rustc_diagnostic_item = "range_step"]
#[rustc_on_unimplemented(
message = "`std::ops::Range<{Self}>` is not an iterator",
label = "not an iterator",
label = "`Range<{Self}>` is not an iterator",
note = "`Range` only implements `Iterator` for select types in the standard library, \
particularly integers; to see the full list of types, see the documentation for the \
unstable `Step` trait"

View file

@ -2,7 +2,7 @@ error[E0277]: `std::ops::Range<T>` is not an iterator
--> missing-bound.rs:2:14
|
2 | for _ in t {}
| ^ not an iterator
| ^ `Range<T>` is not an iterator
|
= note: `Range` only implements `Iterator` for select types in the standard library, particularly integers; to see the full list of types, see the documentation for the unstable `Step` trait
= note: required for `std::ops::Range<T>` to implement `Iterator`

View file

@ -8,7 +8,7 @@ error[E0277]: `std::ops::Range<bool>` is not an iterator
--> $DIR/range-1.rs:9:14
|
LL | for i in false..true {}
| ^^^^^^^^^^^ not an iterator
| ^^^^^^^^^^^ `Range<bool>` is not an iterator
|
= help: the nightly-only, unstable trait `Step` is not implemented for `bool`
= note: `Range` only implements `Iterator` for select types in the standard library, particularly integers; to see the full list of types, see the documentation for the unstable `Step` trait

View file

@ -20,7 +20,7 @@ error[E0277]: `std::ops::Range<T>` is not an iterator
--> $DIR/unstable-trait-suggestion.rs:17:14
|
LL | for _ in t {}
| ^ not an iterator
| ^ `Range<T>` is not an iterator
|
= note: `Range` only implements `Iterator` for select types in the standard library, particularly integers; to see the full list of types, see the documentation for the unstable `Step` trait
= note: required for `std::ops::Range<T>` to implement `Iterator`