From 7c5a895a89e9e6b3950eecc443361281245b50ff Mon Sep 17 00:00:00 2001 From: DrMeepster <19316085+DrMeepster@users.noreply.github.com> Date: Tue, 29 Jun 2021 15:25:08 -0700 Subject: [PATCH] fix test failure from trying to assume_init too much --- library/std/src/io/copy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/std/src/io/copy.rs b/library/std/src/io/copy.rs index a75dbc76278..6ab96662305 100644 --- a/library/std/src/io/copy.rs +++ b/library/std/src/io/copy.rs @@ -103,7 +103,7 @@ impl BufferedCopySpec for BufWriter { return Ok(len); } - init = read_buf.initialized_len(); + init = read_buf.initialized_len() - bytes_read; // SAFETY: ReadBuf guarantees all of its filled bytes are init unsafe { buf.set_len(buf.len() + bytes_read) };