Skip to content

Commit a99b533

Browse files
authored
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.
2 parents f07a0d1 + 41bee76 commit a99b533

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

Diff for: library/alloc/src/vec/mod.rs

-8
Original file line numberDiff line numberDiff line change
@@ -3360,10 +3360,6 @@ impl<T: Hash, A: Allocator> Hash for Vec<T, A> {
33603360
}
33613361

33623362
#[stable(feature = "rust1", since = "1.0.0")]
3363-
#[rustc_on_unimplemented(
3364-
message = "vector indices are of type `usize` or ranges of `usize`",
3365-
label = "vector indices are of type `usize` or ranges of `usize`"
3366-
)]
33673363
impl<T, I: SliceIndex<[T]>, A: Allocator> Index<I> for Vec<T, A> {
33683364
type Output = I::Output;
33693365

@@ -3374,10 +3370,6 @@ impl<T, I: SliceIndex<[T]>, A: Allocator> Index<I> for Vec<T, A> {
33743370
}
33753371

33763372
#[stable(feature = "rust1", since = "1.0.0")]
3377-
#[rustc_on_unimplemented(
3378-
message = "vector indices are of type `usize` or ranges of `usize`",
3379-
label = "vector indices are of type `usize` or ranges of `usize`"
3380-
)]
33813373
impl<T, I: SliceIndex<[T]>, A: Allocator> IndexMut<I> for Vec<T, A> {
33823374
#[inline]
33833375
fn index_mut(&mut self, index: I) -> &mut Self::Output {

Diff for: library/core/src/iter/traits/accum.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use crate::num::Wrapping;
1010
/// [`sum()`]: Iterator::sum
1111
/// [`FromIterator`]: iter::FromIterator
1212
#[stable(feature = "iter_arith_traits", since = "1.12.0")]
13-
#[rustc_on_unimplemented(
13+
#[diagnostic::on_unimplemented(
1414
message = "a value of type `{Self}` cannot be made by summing an iterator over elements of type `{A}`",
1515
label = "value of type `{Self}` cannot be made by summing a `std::iter::Iterator<Item={A}>`"
1616
)]
@@ -31,7 +31,7 @@ pub trait Sum<A = Self>: Sized {
3131
/// [`product()`]: Iterator::product
3232
/// [`FromIterator`]: iter::FromIterator
3333
#[stable(feature = "iter_arith_traits", since = "1.12.0")]
34-
#[rustc_on_unimplemented(
34+
#[diagnostic::on_unimplemented(
3535
message = "a value of type `{Self}` cannot be made by multiplying all elements of type `{A}` from an iterator",
3636
label = "value of type `{Self}` cannot be made by multiplying all elements from a `std::iter::Iterator<Item={A}>`"
3737
)]

0 commit comments

Comments
 (0)