diff options
| author | Jacob Pratt <jacob@jhpratt.dev> | 2025-03-30 17:59:29 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-30 17:59:29 -0400 |
| commit | a99b5339f4639615cc0f0cd60a6c1e75c17b1c03 (patch) | |
| tree | 278b4e2217a51ef4401105d2ef5f29ce27ce4630 | |
| parent | f07a0d117faf37a4bfd6bc6ba91602b456b6b344 (diff) | |
| parent | 41bee761bb81888c09c0567377abdcacf564f6b9 (diff) | |
| download | rust-a99b5339f4639615cc0f0cd60a6c1e75c17b1c03.tar.gz rust-a99b5339f4639615cc0f0cd60a6c1e75c17b1c03.zip | |
Rollup merge of #139141 - mejrs:on_unimpl, r=Noratrieb
Switch some rustc_on_unimplemented uses to diagnostic::on_unimplemented The use on the SliceIndex impl appears unreachable, there is no mention of "vector indices" in any test output and I could not get it to show up in error messages.
| -rw-r--r-- | library/alloc/src/vec/mod.rs | 8 | ||||
| -rw-r--r-- | library/core/src/iter/traits/accum.rs | 4 |
2 files changed, 2 insertions, 10 deletions
diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index 3782f9e9519..633ef717e04 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -3360,10 +3360,6 @@ impl<T: Hash, A: Allocator> Hash for Vec<T, A> { } #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented( - message = "vector indices are of type `usize` or ranges of `usize`", - label = "vector indices are of type `usize` or ranges of `usize`" -)] impl<T, I: SliceIndex<[T]>, A: Allocator> Index<I> for Vec<T, A> { type Output = I::Output; @@ -3374,10 +3370,6 @@ impl<T, I: SliceIndex<[T]>, A: Allocator> Index<I> for Vec<T, A> { } #[stable(feature = "rust1", since = "1.0.0")] -#[rustc_on_unimplemented( - message = "vector indices are of type `usize` or ranges of `usize`", - label = "vector indices are of type `usize` or ranges of `usize`" -)] impl<T, I: SliceIndex<[T]>, A: Allocator> IndexMut<I> for Vec<T, A> { #[inline] fn index_mut(&mut self, index: I) -> &mut Self::Output { diff --git a/library/core/src/iter/traits/accum.rs b/library/core/src/iter/traits/accum.rs index 5b7d95c2f65..12e2b8b393a 100644 --- a/library/core/src/iter/traits/accum.rs +++ b/library/core/src/iter/traits/accum.rs @@ -10,7 +10,7 @@ use crate::num::Wrapping; /// [`sum()`]: Iterator::sum /// [`FromIterator`]: iter::FromIterator #[stable(feature = "iter_arith_traits", since = "1.12.0")] -#[rustc_on_unimplemented( +#[diagnostic::on_unimplemented( message = "a value of type `{Self}` cannot be made by summing an iterator over elements of type `{A}`", label = "value of type `{Self}` cannot be made by summing a `std::iter::Iterator<Item={A}>`" )] @@ -31,7 +31,7 @@ pub trait Sum<A = Self>: Sized { /// [`product()`]: Iterator::product /// [`FromIterator`]: iter::FromIterator #[stable(feature = "iter_arith_traits", since = "1.12.0")] -#[rustc_on_unimplemented( +#[diagnostic::on_unimplemented( message = "a value of type `{Self}` cannot be made by multiplying all elements of type `{A}` from an iterator", label = "value of type `{Self}` cannot be made by multiplying all elements from a `std::iter::Iterator<Item={A}>`" )] |
