Skip to content

Commit 0c35b26

Browse files
committed
Auto merge of rust-lang#116483 - GuillaumeGomez:rollup-z65pno1, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - rust-lang#115454 (Clarify example in docs of str::char_slice) - rust-lang#115522 (Clarify ManuallyDrop bit validity) - rust-lang#115588 (Fix a comment in std::iter::successors) - rust-lang#116198 (Add more diagnostic items for clippy) - rust-lang#116329 (update some comments around swap()) - rust-lang#116475 (rustdoc-search: fix bug with multi-item impl trait) r? `@ghost` `@rustbot` modify labels: rollup
2 parents fd6372d + 67cd509 commit 0c35b26

33 files changed

+64
-15
lines changed

alloc/src/borrow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ pub trait ToOwned {
5555
/// ```
5656
#[stable(feature = "rust1", since = "1.0.0")]
5757
#[must_use = "cloning is often expensive and is not expected to have side effects"]
58+
#[cfg_attr(not(test), rustc_diagnostic_item = "to_owned_method")]
5859
fn to_owned(&self) -> Self::Owned;
5960

6061
/// Uses borrowed data to replace owned data, usually by cloning.

alloc/src/rc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2701,6 +2701,7 @@ impl<T, I: iter::TrustedLen<Item = T>> ToRcSlice<T> for I {
27012701
///
27022702
/// [`upgrade`]: Weak::upgrade
27032703
#[stable(feature = "rc_weak", since = "1.4.0")]
2704+
#[cfg_attr(not(test), rustc_diagnostic_item = "RcWeak")]
27042705
pub struct Weak<
27052706
T: ?Sized,
27062707
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,

alloc/src/string.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2435,6 +2435,7 @@ pub trait ToString {
24352435
/// ```
24362436
#[rustc_conversion_suggestion]
24372437
#[stable(feature = "rust1", since = "1.0.0")]
2438+
#[cfg_attr(not(test), rustc_diagnostic_item = "to_string_method")]
24382439
fn to_string(&self) -> String;
24392440
}
24402441

alloc/src/sync.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
311311
///
312312
/// [`upgrade`]: Weak::upgrade
313313
#[stable(feature = "arc_weak", since = "1.4.0")]
314+
#[cfg_attr(not(test), rustc_diagnostic_item = "ArcWeak")]
314315
pub struct Weak<
315316
T: ?Sized,
316317
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,

core/src/array/iter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use crate::{
1313
/// A by-value [array] iterator.
1414
#[stable(feature = "array_value_iter", since = "1.51.0")]
1515
#[rustc_insignificant_dtor]
16+
#[rustc_diagnostic_item = "ArrayIntoIter"]
1617
pub struct IntoIter<T, const N: usize> {
1718
/// This is the array we are iterating over.
1819
///

core/src/cell.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,6 +1423,7 @@ impl Clone for BorrowRef<'_> {
14231423
/// See the [module-level documentation](self) for more.
14241424
#[stable(feature = "rust1", since = "1.0.0")]
14251425
#[must_not_suspend = "holding a Ref across suspend points can cause BorrowErrors"]
1426+
#[rustc_diagnostic_item = "RefCellRef"]
14261427
pub struct Ref<'b, T: ?Sized + 'b> {
14271428
// NB: we use a pointer instead of `&'b T` to avoid `noalias` violations, because a
14281429
// `Ref` argument doesn't hold immutability for its whole scope, only until it drops.
@@ -1804,6 +1805,7 @@ impl<'b> BorrowRefMut<'b> {
18041805
/// See the [module-level documentation](self) for more.
18051806
#[stable(feature = "rust1", since = "1.0.0")]
18061807
#[must_not_suspend = "holding a RefMut across suspend points can cause BorrowErrors"]
1808+
#[rustc_diagnostic_item = "RefCellRefMut"]
18071809
pub struct RefMut<'b, T: ?Sized + 'b> {
18081810
// NB: we use a pointer instead of `&'b mut T` to avoid `noalias` violations, because a
18091811
// `RefMut` argument doesn't hold exclusivity for its whole scope, only until it drops.

core/src/cmp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,7 @@ pub trait Ord: Eq + PartialOrd<Self> {
809809
/// ```
810810
#[must_use]
811811
#[stable(feature = "rust1", since = "1.0.0")]
812+
#[rustc_diagnostic_item = "ord_cmp_method"]
812813
fn cmp(&self, other: &Self) -> Ordering;
813814

814815
/// Compares and returns the maximum of two values.

core/src/convert/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ pub use num::FloatToInt;
100100
#[stable(feature = "convert_id", since = "1.33.0")]
101101
#[rustc_const_stable(feature = "const_identity", since = "1.33.0")]
102102
#[inline(always)]
103+
#[rustc_diagnostic_item = "convert_identity"]
103104
pub const fn identity<T>(x: T) -> T {
104105
x
105106
}
@@ -642,6 +643,7 @@ pub trait TryFrom<T>: Sized {
642643

643644
/// Performs the conversion.
644645
#[stable(feature = "try_from", since = "1.34.0")]
646+
#[rustc_diagnostic_item = "try_from_fn"]
645647
fn try_from(value: T) -> Result<Self, Self::Error>;
646648
}
647649

core/src/default.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ pub trait Default: Sized {
130130
/// }
131131
/// ```
132132
#[stable(feature = "rust1", since = "1.0.0")]
133+
#[rustc_diagnostic_item = "default_fn"]
133134
fn default() -> Self;
134135
}
135136

core/src/fmt/builders.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ impl fmt::Write for PadAdapter<'_, '_> {
8484
#[must_use = "must eventually call `finish()` on Debug builders"]
8585
#[allow(missing_debug_implementations)]
8686
#[stable(feature = "debug_builders", since = "1.2.0")]
87+
#[rustc_diagnostic_item = "DebugStruct"]
8788
pub struct DebugStruct<'a, 'b: 'a> {
8889
fmt: &'a mut fmt::Formatter<'b>,
8990
result: fmt::Result,

0 commit comments

Comments
 (0)