summaryrefslogtreecommitdiffstats
path: root/tokio/src/io
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2019-11-05 23:38:52 -0800
committerGitHub <noreply@github.com>2019-11-05 23:38:52 -0800
commit0da23aad772afb22db8edf73ac0f034c5ada3bde (patch)
treeacebe4125a39a5ee81815b19587ffad400559bb8 /tokio/src/io
parentd5c1119c881c9a8b511aa9000fd26b9bda014256 (diff)
fix clippy (#1737)
Diffstat (limited to 'tokio/src/io')
-rw-r--r--tokio/src/io/async_read.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tokio/src/io/async_read.rs b/tokio/src/io/async_read.rs
index 2bccb17f..8f6e0b98 100644
--- a/tokio/src/io/async_read.rs
+++ b/tokio/src/io/async_read.rs
@@ -57,6 +57,11 @@ pub trait AsyncRead {
///
/// This function is called from [`poll_read_buf`].
///
+ /// # Safety
+ ///
+ /// Implementations that return `false` must never read from data slices
+ /// that they did not write to.
+ ///
/// [`io::Read`]: std::io::Read
/// [`poll_read_buf`]: #method.poll_read_buf
unsafe fn prepare_uninitialized_buffer(&self, buf: &mut [u8]) -> bool {