diff --git a/library/core/src/iter/range.rs b/library/core/src/iter/range.rs index 0be1e8699bf5..7880e18d7d31 100644 --- a/library/core/src/iter/range.rs +++ b/library/core/src/iter/range.rs @@ -23,6 +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", 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" diff --git a/tests/run-make/missing-unstable-trait-bound/missing-bound.stderr b/tests/run-make/missing-unstable-trait-bound/missing-bound.stderr index e8a7d808bbee..d503751a2e93 100644 --- a/tests/run-make/missing-unstable-trait-bound/missing-bound.stderr +++ b/tests/run-make/missing-unstable-trait-bound/missing-bound.stderr @@ -2,7 +2,7 @@ error[E0277]: `std::ops::Range` is not an iterator --> missing-bound.rs:2:14 | 2 | for _ in t {} - | ^ the nightly-only, unstable trait `Step` is not implemented for `T` + | ^ 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` to implement `Iterator` diff --git a/tests/ui/range/range-1.stderr b/tests/ui/range/range-1.stderr index 5491d06aee09..9682122539c5 100644 --- a/tests/ui/range/range-1.stderr +++ b/tests/ui/range/range-1.stderr @@ -8,8 +8,9 @@ error[E0277]: `std::ops::Range` is not an iterator --> $DIR/range-1.rs:9:14 | LL | for i in false..true {} - | ^^^^^^^^^^^ the nightly-only, unstable trait `Step` is not implemented for `bool` + | ^^^^^^^^^^^ 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 = note: required for `std::ops::Range` to implement `Iterator` = note: required for `std::ops::Range` to implement `IntoIterator` diff --git a/tests/ui/trait-bounds/unstable-trait-suggestion.stderr b/tests/ui/trait-bounds/unstable-trait-suggestion.stderr index 011e56044bfe..5edaed0f4dfe 100644 --- a/tests/ui/trait-bounds/unstable-trait-suggestion.stderr +++ b/tests/ui/trait-bounds/unstable-trait-suggestion.stderr @@ -20,7 +20,7 @@ error[E0277]: `std::ops::Range` is not an iterator --> $DIR/unstable-trait-suggestion.rs:17:14 | LL | for _ in t {} - | ^ the nightly-only, unstable trait `Step` is not implemented for `T` + | ^ 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` to implement `Iterator`