diff options
| author | Urgau <3616612+Urgau@users.noreply.github.com> | 2025-02-18 18:34:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-18 18:34:18 +0100 |
| commit | b7c2da2231baa52353df219b7964bbd97eda1765 (patch) | |
| tree | 541451f55e7b7cccb7ab3f86708202c88d2169b4 /library/std/src | |
| parent | 61f04328db68eab599a64b120ba4d63b425df257 (diff) | |
| parent | a72402a0f950e92758600aa7996899b5241bb6a5 (diff) | |
Rollup merge of #137214 - cyrgani:clippy_diagnostic_items, r=compiler-errors
add last std diagnostic items for clippy Part of https://github.com/rust-lang/rust-clippy/issues/5393. Add diagnostic item attributes to the items in `std` and `core` where clippy currently uses hardcoded paths (https://github.com/rust-lang/rust-clippy/blob/master/clippy_utils/src/paths.rs).
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/io/stdio.rs | 1 | ||||
| -rw-r--r-- | library/std/src/panic.rs | 1 | ||||
| -rw-r--r-- | library/std/src/process.rs | 4 |
3 files changed, 6 insertions, 0 deletions
diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs index 318c3508221..661c422811a 100644 --- a/library/std/src/io/stdio.rs +++ b/library/std/src/io/stdio.rs @@ -239,6 +239,7 @@ fn handle_ebadf_lazy<T>(r: io::Result<T>, default: impl FnOnce() -> T) -> io::Re /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] +#[cfg_attr(not(test), rustc_diagnostic_item = "Stdin")] pub struct Stdin { inner: &'static Mutex<BufReader<StdinRaw>>, } diff --git a/library/std/src/panic.rs b/library/std/src/panic.rs index 61801db072a..22776ae2bc4 100644 --- a/library/std/src/panic.rs +++ b/library/std/src/panic.rs @@ -255,6 +255,7 @@ pub use crate::panicking::{set_hook, take_hook}; #[stable(feature = "panic_any", since = "1.51.0")] #[inline] #[track_caller] +#[cfg_attr(not(test), rustc_diagnostic_item = "panic_any")] pub fn panic_any<M: 'static + Any + Send>(msg: M) -> ! { crate::panicking::begin_panic(msg); } diff --git a/library/std/src/process.rs b/library/std/src/process.rs index fd0fd1cb755..bdd4844b651 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -217,6 +217,7 @@ use crate::{fmt, fs, str}; /// /// [`wait`]: Child::wait #[stable(feature = "process", since = "1.0.0")] +#[cfg_attr(not(test), rustc_diagnostic_item = "Child")] pub struct Child { pub(crate) handle: imp::Process, @@ -2115,6 +2116,7 @@ impl Child { /// [`ErrorKind`]: io::ErrorKind /// [`InvalidInput`]: io::ErrorKind::InvalidInput #[stable(feature = "process", since = "1.0.0")] + #[cfg_attr(not(test), rustc_diagnostic_item = "child_kill")] pub fn kill(&mut self) -> io::Result<()> { self.handle.kill() } @@ -2135,6 +2137,7 @@ impl Child { /// ``` #[must_use] #[stable(feature = "process_id", since = "1.3.0")] + #[cfg_attr(not(test), rustc_diagnostic_item = "child_id")] pub fn id(&self) -> u32 { self.handle.id() } @@ -2375,6 +2378,7 @@ pub fn exit(code: i32) -> ! { /// [panic hook]: crate::panic::set_hook #[stable(feature = "process_abort", since = "1.17.0")] #[cold] +#[cfg_attr(not(test), rustc_diagnostic_item = "process_abort")] pub fn abort() -> ! { crate::sys::abort_internal(); } |
