Skip to content

Commit 1bc0463

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 6683f13 + 5674092 commit 1bc0463

File tree

84 files changed

+328
-294
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+328
-294
lines changed

compiler/rustc_middle/src/mir/syntax.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ pub type AssertMessage<'tcx> = AssertKind<Operand<'tcx>>;
996996
///
997997
/// [UCG#319]: https://github.com/rust-lang/unsafe-code-guidelines/issues/319
998998
///
999-
/// Rust currently requires that every place obey those two rules. This is checked by MIRI and taken
999+
/// Rust currently requires that every place obey those two rules. This is checked by Miri and taken
10001000
/// advantage of by codegen (via `gep inbounds`). That is possibly subject to change.
10011001
#[derive(Copy, Clone, PartialEq, Eq, Hash, TyEncodable, HashStable, TypeFoldable, TypeVisitable)]
10021002
pub struct Place<'tcx> {

compiler/rustc_span/src/symbol.rs

+49
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,11 @@ symbols! {
129129
Alignment,
130130
Any,
131131
Arc,
132+
ArcWeak,
132133
Argument,
133134
ArgumentMethods,
134135
Arguments,
136+
ArrayIntoIter,
135137
AsMut,
136138
AsRef,
137139
AssertParamIsClone,
@@ -164,13 +166,15 @@ symbols! {
164166
Capture,
165167
Center,
166168
Clone,
169+
Command,
167170
ConstParamTy,
168171
Context,
169172
Continue,
170173
Copy,
171174
Count,
172175
Cow,
173176
Debug,
177+
DebugStruct,
174178
Decodable,
175179
Decoder,
176180
DecorateLint,
@@ -194,6 +198,8 @@ symbols! {
194198
From,
195199
FromIterator,
196200
FromResidual,
201+
FsOpenOptions,
202+
FsPermissions,
197203
Future,
198204
FutureOutput,
199205
FxHashMap,
@@ -207,16 +213,22 @@ symbols! {
207213
Implied,
208214
IndexOutput,
209215
Input,
216+
Instant,
210217
Into,
211218
IntoDiagnostic,
212219
IntoFuture,
213220
IntoIterator,
221+
IoLines,
214222
IoRead,
223+
IoSeek,
215224
IoWrite,
216225
IpAddr,
217226
IrTyKind,
218227
Is,
219228
ItemContext,
229+
IterEmpty,
230+
IterOnce,
231+
IterPeekable,
220232
Iterator,
221233
IteratorItem,
222234
Layout,
@@ -227,6 +239,7 @@ symbols! {
227239
Mutex,
228240
MutexGuard,
229241
N,
242+
NonNull,
230243
NonZeroI128,
231244
NonZeroI16,
232245
NonZeroI32,
@@ -259,15 +272,19 @@ symbols! {
259272
ProcMacro,
260273
ProceduralMasqueradeDummyType,
261274
Range,
275+
RangeBounds,
262276
RangeFrom,
263277
RangeFull,
264278
RangeInclusive,
265279
RangeTo,
266280
RangeToInclusive,
267281
Rc,
282+
RcWeak,
268283
Ready,
269284
Receiver,
270285
RefCell,
286+
RefCellRef,
287+
RefCellRefMut,
271288
Relaxed,
272289
Release,
273290
Result,
@@ -284,6 +301,7 @@ symbols! {
284301
Send,
285302
SeqCst,
286303
SliceIndex,
304+
SliceIter,
287305
Some,
288306
String,
289307
StructuralEq,
@@ -561,6 +579,7 @@ symbols! {
561579
constant,
562580
constructor,
563581
context,
582+
convert_identity,
564583
copy,
565584
copy_closures,
566585
copy_nonoverlapping,
@@ -616,6 +635,7 @@ symbols! {
616635
declare_lint_pass,
617636
decode,
618637
default_alloc_error_handler,
638+
default_fn,
619639
default_lib_allocator,
620640
default_method_body_is_const,
621641
default_type_parameter_fallback,
@@ -628,6 +648,7 @@ symbols! {
628648
deref,
629649
deref_method,
630650
deref_mut,
651+
deref_mut_method,
631652
deref_target,
632653
derive,
633654
derive_const,
@@ -777,11 +798,14 @@ symbols! {
777798
from_desugaring,
778799
from_fn,
779800
from_iter,
801+
from_iter_fn,
780802
from_output,
781803
from_residual,
782804
from_size_align_unchecked,
805+
from_str_method,
783806
from_usize,
784807
from_yeet,
808+
fs_create_dir,
785809
fsub_fast,
786810
fundamental,
787811
future,
@@ -868,6 +892,10 @@ symbols! {
868892
into_iter,
869893
intra_doc_pointers,
870894
intrinsics,
895+
intrinsics_unaligned_volatile_load,
896+
intrinsics_unaligned_volatile_store,
897+
io_stderr,
898+
io_stdout,
871899
irrefutable_let_patterns,
872900
isa_attribute,
873901
isize,
@@ -962,6 +990,7 @@ symbols! {
962990
mem_replace,
963991
mem_size_of,
964992
mem_size_of_val,
993+
mem_swap,
965994
mem_uninitialized,
966995
mem_variant_count,
967996
mem_zeroed,
@@ -1091,6 +1120,7 @@ symbols! {
10911120
options,
10921121
or,
10931122
or_patterns,
1123+
ord_cmp_method,
10941124
other,
10951125
out,
10961126
overflow_checks,
@@ -1171,13 +1201,18 @@ symbols! {
11711201
proc_macro_mod,
11721202
proc_macro_non_items,
11731203
proc_macro_path_invoc,
1204+
process_exit,
11741205
profiler_builtins,
11751206
profiler_runtime,
11761207
ptr,
11771208
ptr_cast,
11781209
ptr_cast_const,
11791210
ptr_cast_mut,
11801211
ptr_const_is_null,
1212+
ptr_copy,
1213+
ptr_copy_nonoverlapping,
1214+
ptr_drop_in_place,
1215+
ptr_eq,
11811216
ptr_from_ref,
11821217
ptr_guaranteed_cmp,
11831218
ptr_is_null,
@@ -1186,8 +1221,17 @@ symbols! {
11861221
ptr_null_mut,
11871222
ptr_offset_from,
11881223
ptr_offset_from_unsigned,
1224+
ptr_read,
1225+
ptr_read_unaligned,
1226+
ptr_read_volatile,
1227+
ptr_replace,
1228+
ptr_slice_from_raw_parts,
1229+
ptr_slice_from_raw_parts_mut,
1230+
ptr_swap,
1231+
ptr_swap_nonoverlapping,
11891232
ptr_unique,
11901233
ptr_write,
1234+
ptr_write_bytes,
11911235
ptr_write_unaligned,
11921236
ptr_write_volatile,
11931237
pub_macro_rules,
@@ -1478,6 +1522,8 @@ symbols! {
14781522
sized,
14791523
skip,
14801524
slice,
1525+
slice_from_raw_parts,
1526+
slice_from_raw_parts_mut,
14811527
slice_len_fn,
14821528
slice_patterns,
14831529
slicing_syntax,
@@ -1565,7 +1611,9 @@ symbols! {
15651611
thumb2,
15661612
thumb_mode: "thumb-mode",
15671613
tmm_reg,
1614+
to_owned_method,
15681615
to_string,
1616+
to_string_method,
15691617
to_vec,
15701618
todo_macro,
15711619
tool_attributes,
@@ -1588,6 +1636,7 @@ symbols! {
15881636
try_blocks,
15891637
try_capture,
15901638
try_from,
1639+
try_from_fn,
15911640
try_into,
15921641
try_trait_v2,
15931642
tt,

library/alloc/src/borrow.rs

+1
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.

library/alloc/src/rc.rs

+1
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,

library/alloc/src/string.rs

+1
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

library/alloc/src/sync.rs

+1
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,

library/core/src/array/iter.rs

+1
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
///

library/core/src/cell.rs

+2
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.

library/core/src/cmp.rs

+1
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.

library/core/src/convert/mod.rs

+2
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

library/core/src/default.rs

+1
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

library/core/src/fmt/builders.rs

+1
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,

library/core/src/fmt/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ impl<W: Write + ?Sized> Write for &mut W {
239239
/// documentation of the methods defined on `Formatter` below.
240240
#[allow(missing_debug_implementations)]
241241
#[stable(feature = "rust1", since = "1.0.0")]
242+
#[rustc_diagnostic_item = "Formatter"]
242243
pub struct Formatter<'a> {
243244
flags: u32,
244245
fill: char,

library/core/src/intrinsics.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1509,12 +1509,14 @@ extern "rust-intrinsic" {
15091509
///
15101510
/// This intrinsic does not have a stable counterpart.
15111511
#[rustc_nounwind]
1512+
#[rustc_diagnostic_item = "intrinsics_unaligned_volatile_load"]
15121513
pub fn unaligned_volatile_load<T>(src: *const T) -> T;
15131514
/// Performs a volatile store to the `dst` pointer.
15141515
/// The pointer is not required to be aligned.
15151516
///
15161517
/// This intrinsic does not have a stable counterpart.
15171518
#[rustc_nounwind]
1519+
#[rustc_diagnostic_item = "intrinsics_unaligned_volatile_store"]
15181520
pub fn unaligned_volatile_store<T>(dst: *mut T, val: T);
15191521

15201522
/// Returns the square root of an `f32`
@@ -2666,6 +2668,7 @@ pub(crate) fn is_nonoverlapping<T>(src: *const T, dst: *const T, count: usize) -
26662668
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
26672669
#[inline(always)]
26682670
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
2671+
#[rustc_diagnostic_item = "ptr_copy_nonoverlapping"]
26692672
pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize) {
26702673
extern "rust-intrinsic" {
26712674
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
@@ -2761,6 +2764,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
27612764
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
27622765
#[inline(always)]
27632766
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
2767+
#[rustc_diagnostic_item = "ptr_copy"]
27642768
pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
27652769
extern "rust-intrinsic" {
27662770
#[rustc_const_stable(feature = "const_intrinsic_copy", since = "1.63.0")]
@@ -2834,6 +2838,7 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
28342838
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]
28352839
#[inline(always)]
28362840
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
2841+
#[rustc_diagnostic_item = "ptr_write_bytes"]
28372842
pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
28382843
extern "rust-intrinsic" {
28392844
#[rustc_const_unstable(feature = "const_ptr_write", issue = "86302")]

library/core/src/iter/adapters/peekable.rs

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::ops::{ControlFlow, Try};
1212
#[derive(Clone, Debug)]
1313
#[must_use = "iterators are lazy and do nothing unless consumed"]
1414
#[stable(feature = "rust1", since = "1.0.0")]
15+
#[rustc_diagnostic_item = "IterPeekable"]
1516
pub struct Peekable<I: Iterator> {
1617
iter: I,
1718
/// Remember a peeked value, even if it was None.

library/core/src/iter/sources/empty.rs

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub const fn empty<T>() -> Empty<T> {
2727
/// This `struct` is created by the [`empty()`] function. See its documentation for more.
2828
#[must_use = "iterators are lazy and do nothing unless consumed"]
2929
#[stable(feature = "iter_empty", since = "1.2.0")]
30+
#[rustc_diagnostic_item = "IterEmpty"]
3031
pub struct Empty<T>(marker::PhantomData<fn() -> T>);
3132

3233
#[stable(feature = "core_impl_debug", since = "1.9.0")]

0 commit comments

Comments
 (0)