Skip to content

Commit 5ef2025

Browse files
committed
add diagnostic items
Add diagnostic items to the following types: OsString (os_string_type) PathBuf (path_buf_type) Owned (to_owned_trait) As well as the to_vec method on slice/[T]
1 parent b86674e commit 5ef2025

File tree

5 files changed

+8
-0
lines changed

5 files changed

+8
-0
lines changed

compiler/rustc_span/src/symbol.rs

+4
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,7 @@ symbols! {
796796
options,
797797
or,
798798
or_patterns,
799+
os_string_type,
799800
other,
800801
out,
801802
overlapping_marker_traits,
@@ -824,6 +825,7 @@ symbols! {
824825
pat2018,
825826
pat2021,
826827
path,
828+
path_buf_type,
827829
pattern_parentheses,
828830
phantom_data,
829831
pin,
@@ -1084,6 +1086,7 @@ symbols! {
10841086
slice,
10851087
slice_alloc,
10861088
slice_patterns,
1089+
slice_to_vec_method,
10871090
slice_u8,
10881091
slice_u8_alloc,
10891092
slicing_syntax,
@@ -1159,6 +1162,7 @@ symbols! {
11591162
then_with,
11601163
thread,
11611164
thread_local,
1165+
to_owned_trait,
11621166
tool_attributes,
11631167
tool_lints,
11641168
trace_macros,

library/alloc/src/borrow.rs

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ where
3232
/// to `T`. The `ToOwned` trait generalizes `Clone` to construct owned data
3333
/// from any borrow of a given type.
3434
#[stable(feature = "rust1", since = "1.0.0")]
35+
#[cfg_attr(not(test), rustc_diagnostic_item = "to_owned_trait")]
3536
pub trait ToOwned {
3637
/// The resulting type after obtaining ownership.
3738
#[stable(feature = "rust1", since = "1.0.0")]

library/alloc/src/slice.rs

+1
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ impl<T> [T] {
442442
/// // Here, `s` and `x` can be modified independently.
443443
/// ```
444444
#[rustc_conversion_suggestion]
445+
#[rustc_diagnostic_item = "slice_to_vec_method"]
445446
#[stable(feature = "rust1", since = "1.0.0")]
446447
#[inline]
447448
pub fn to_vec(&self) -> Vec<T>

library/std/src/ffi/os_str.rs

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ use crate::sys_common::{AsInner, FromInner, IntoInner};
7171
/// [`CStr`]: crate::ffi::CStr
7272
/// [conversions]: super#conversions
7373
#[derive(Clone)]
74+
#[cfg_attr(not(test), rustc_diagnostic_item = "os_string_type")]
7475
#[stable(feature = "rust1", since = "1.0.0")]
7576
pub struct OsString {
7677
inner: Buf,

library/std/src/path.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,7 @@ impl FusedIterator for Ancestors<'_> {}
10661066
///
10671067
/// Which method works best depends on what kind of situation you're in.
10681068
#[derive(Clone)]
1069+
#[cfg_attr(not(test), rustc_diagnostic_item = "path_buf_type")]
10691070
#[stable(feature = "rust1", since = "1.0.0")]
10701071
// FIXME:
10711072
// `PathBuf::as_mut_vec` current implementation relies

0 commit comments

Comments
 (0)