Add diagnostic item for std::io::BufRead

This will be used in Clippy to detect unbuffered calls to
`Read::bytes()`.
This commit is contained in:
Samuel Tardieu 2025-02-12 22:18:27 +01:00
parent ced8e650cd
commit f8930b44a5
2 changed files with 2 additions and 0 deletions

View file

@ -250,6 +250,7 @@ symbols! {
Into,
IntoFuture,
IntoIterator,
IoBufRead,
IoLines,
IoRead,
IoSeek,

View file

@ -2249,6 +2249,7 @@ fn skip_until<R: BufRead + ?Sized>(r: &mut R, delim: u8) -> Result<usize> {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), rustc_diagnostic_item = "IoBufRead")]
pub trait BufRead: Read {
/// Returns the contents of the internal buffer, filling it with more data
/// from the inner reader if it is empty.