From eee01dd21138c376b1f64e49f7f76b9f6121c5ec Mon Sep 17 00:00:00 2001 From: Vincent Whitchurch Date: Thu, 26 Mar 2026 09:38:27 +0000 Subject: [PATCH] Add `IoSplit` diagnostic item for `std::io::Split` Similar to the existing `IoLines` item. It will be used in Clippy to detect uses of `Split` leading to infinite loops similar to the existing lint for `Lines`. --- library/std/src/io/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs index 623c34c6d2910..cba578cd3a6fa 100644 --- a/library/std/src/io/mod.rs +++ b/library/std/src/io/mod.rs @@ -3348,6 +3348,7 @@ impl SizeHint for &[u8] { /// [`split`]: BufRead::split #[stable(feature = "rust1", since = "1.0.0")] #[derive(Debug)] +#[cfg_attr(not(test), rustc_diagnostic_item = "IoSplit")] pub struct Split { buf: B, delim: u8,