From c6aceed64397e275d300e1233a3304ace02a7765 Mon Sep 17 00:00:00 2001 From: Martin Grigorov Date: Sat, 6 Sep 2025 08:42:35 +0300 Subject: [PATCH] io: clarify the zero capacity case of `AsyncRead::poll_read` (#7580) Signed-off-by: Martin Tzvetanov Grigorov --- tokio/src/io/async_read.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tokio/src/io/async_read.rs b/tokio/src/io/async_read.rs index 76b93bcb0..2efd9d11f 100644 --- a/tokio/src/io/async_read.rs +++ b/tokio/src/io/async_read.rs @@ -46,7 +46,8 @@ pub trait AsyncRead { /// /// On success, returns `Poll::Ready(Ok(()))` and places data in the /// unfilled portion of `buf`. If no data was read (`buf.filled().len()` is - /// unchanged), it implies that EOF has been reached. + /// unchanged), it implies that EOF has been reached, or the output buffer + /// had zero capacity (i.e. `buf.remaining()` == 0). /// /// If no data is available for reading, the method returns `Poll::Pending` /// and arranges for the current task (via `cx.waker()`) to receive a