From 57d455b6c871703181aba388a614c5f5adb22230 Mon Sep 17 00:00:00 2001 From: xizheyin Date: Wed, 19 Aug 2026 02:46:54 +0800 Subject: [PATCH] Doc: clarify how `Read::bytes` handling Interrupted errors --- library/alloc/src/io/read.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/library/alloc/src/io/read.rs b/library/alloc/src/io/read.rs index e3d26218c09a0..2f4e891aa4429 100644 --- a/library/alloc/src/io/read.rs +++ b/library/alloc/src/io/read.rs @@ -488,6 +488,14 @@ pub trait Read { /// which can be very inefficient for data that's not in memory, /// such as `File`. Consider using a `BufReader` in such cases. /// + /// # Errors + /// + /// When the returned iterator calls [`Iterator::next`], + /// if it encounters an error of the kind [`ErrorKind::Interrupted`] + /// then the error is ignored and it will try to read the byte again. + /// + /// [`ErrorKind::Interrupted`]: crate::io::ErrorKind::Interrupted + /// /// # Examples /// /// `File`s implement `Read`: