Skip to content

Commit 6a9f223

Browse files
committed
Add diagnostic items for Clippy
1 parent 3b97f13 commit 6a9f223

File tree

7 files changed

+14
-0
lines changed

7 files changed

+14
-0
lines changed

compiler/rustc_span/src/symbol.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ symbols! {
642642
cfi_encoding,
643643
char,
644644
char_is_ascii,
645+
char_to_digit,
645646
child_id,
646647
child_kill,
647648
client,
@@ -1217,6 +1218,8 @@ symbols! {
12171218
intrinsics,
12181219
intrinsics_unaligned_volatile_load,
12191220
intrinsics_unaligned_volatile_store,
1221+
io_error_new,
1222+
io_errorkind,
12201223
io_stderr,
12211224
io_stdout,
12221225
irrefutable_let_patterns,
@@ -1306,6 +1309,7 @@ symbols! {
13061309
m68k_target_feature,
13071310
macro_at_most_once_rep,
13081311
macro_attributes_in_derive_output,
1312+
macro_concat,
13091313
macro_escape,
13101314
macro_export,
13111315
macro_lifetime_matcher,
@@ -1340,6 +1344,7 @@ symbols! {
13401344
maybe_uninit,
13411345
maybe_uninit_uninit,
13421346
maybe_uninit_zeroed,
1347+
mem_align_of,
13431348
mem_discriminant,
13441349
mem_drop,
13451350
mem_forget,
@@ -1707,6 +1712,7 @@ symbols! {
17071712
question_mark,
17081713
quote,
17091714
range_inclusive_new,
1715+
range_step,
17101716
raw_dylib,
17111717
raw_dylib_elf,
17121718
raw_eq,
@@ -2023,6 +2029,7 @@ symbols! {
20232029
slice,
20242030
slice_from_raw_parts,
20252031
slice_from_raw_parts_mut,
2032+
slice_from_ref,
20262033
slice_get_unchecked,
20272034
slice_into_vec,
20282035
slice_iter,

library/core/src/char/methods.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ impl char {
395395
/// ```
396396
#[stable(feature = "rust1", since = "1.0.0")]
397397
#[rustc_const_stable(feature = "const_char_convert", since = "1.67.0")]
398+
#[rustc_diagnostic_item = "char_to_digit"]
398399
#[must_use = "this returns the result of the operation, \
399400
without modifying the original"]
400401
#[inline]

library/core/src/iter/range.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ unsafe_impl_trusted_step![AsciiChar char i8 i16 i32 i64 i128 isize u8 u16 u32 u6
2020
///
2121
/// The *successor* operation moves towards values that compare greater.
2222
/// The *predecessor* operation moves towards values that compare lesser.
23+
#[rustc_diagnostic_item = "range_step"]
2324
#[unstable(feature = "step_trait", issue = "42168")]
2425
pub trait Step: Clone + PartialOrd + Sized {
2526
/// Returns the bounds on the number of *successor* steps required to get from `start` to `end`

library/core/src/macros/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1192,6 +1192,7 @@ pub(crate) mod builtin {
11921192
/// ```
11931193
#[stable(feature = "rust1", since = "1.0.0")]
11941194
#[rustc_builtin_macro]
1195+
#[rustc_diagnostic_item = "macro_concat"]
11951196
#[macro_export]
11961197
macro_rules! concat {
11971198
($($e:expr),* $(,)?) => {{ /* compiler built-in */ }};

library/core/src/mem/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ pub fn min_align_of_val<T: ?Sized>(val: &T) -> usize {
481481
#[stable(feature = "rust1", since = "1.0.0")]
482482
#[rustc_promotable]
483483
#[rustc_const_stable(feature = "const_align_of", since = "1.24.0")]
484+
#[rustc_diagnostic_item = "mem_align_of"]
484485
pub const fn align_of<T>() -> usize {
485486
intrinsics::align_of::<T>()
486487
}

library/core/src/slice/raw.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ pub const unsafe fn from_raw_parts_mut<'a, T>(data: *mut T, len: usize) -> &'a m
198198
/// Converts a reference to T into a slice of length 1 (without copying).
199199
#[stable(feature = "from_ref", since = "1.28.0")]
200200
#[rustc_const_stable(feature = "const_slice_from_ref_shared", since = "1.63.0")]
201+
#[rustc_diagnostic_item = "slice_from_ref"]
201202
#[must_use]
202203
pub const fn from_ref<T>(s: &T) -> &[T] {
203204
array::from_ref(s)

library/std/src/io/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ struct Custom {
219219
/// the recognized error kinds and fail in those cases.
220220
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
221221
#[stable(feature = "rust1", since = "1.0.0")]
222+
#[cfg_attr(not(test), rustc_diagnostic_item = "io_errorkind")]
222223
#[allow(deprecated)]
223224
#[non_exhaustive]
224225
pub enum ErrorKind {
@@ -562,6 +563,7 @@ impl Error {
562563
/// let eof_error = Error::from(ErrorKind::UnexpectedEof);
563564
/// ```
564565
#[stable(feature = "rust1", since = "1.0.0")]
566+
#[cfg_attr(not(test), rustc_diagnostic_item = "io_error_new")]
565567
#[inline(never)]
566568
pub fn new<E>(kind: ErrorKind, error: E) -> Error
567569
where

0 commit comments

Comments
 (0)