about summary refs log tree commit diff
path: root/library/std/src/io/mod.rs
diff options
context:
space:
mode:
authorLaurențiu Nicola <lnicola@users.noreply.github.com>2025-07-21 06:58:10 +0000
committerGitHub <noreply@github.com>2025-07-21 06:58:10 +0000
commit8f67bcf4b0524b2efcbeeae50d393b1b51474237 (patch)
tree17b8a9144bf203d4f3184df4d3e471743bbffe07 /library/std/src/io/mod.rs
parent4bbe74bb6cabb1f30775081254614ccda6985d8a (diff)
parentda90db796d0cf39658eac0074c63e5e9ffec2ff2 (diff)
downloadrust-8f67bcf4b0524b2efcbeeae50d393b1b51474237.tar.gz
rust-8f67bcf4b0524b2efcbeeae50d393b1b51474237.zip
Merge pull request #20268 from lnicola/sync-from-rust
minor: Sync from downstream
Diffstat (limited to 'library/std/src/io/mod.rs')
-rw-r--r--library/std/src/io/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/library/std/src/io/mod.rs b/library/std/src/io/mod.rs
index 17c32d7a571..d351ee5e739 100644
--- a/library/std/src/io/mod.rs
+++ b/library/std/src/io/mod.rs
@@ -489,7 +489,7 @@ pub(crate) fn default_read_to_end<R: Read + ?Sized>(
             }
         };
 
-        let unfilled_but_initialized = cursor.init_ref().len();
+        let unfilled_but_initialized = cursor.init_mut().len();
         let bytes_read = cursor.written();
         let was_fully_initialized = read_buf.init_len() == buf_len;
 
@@ -3053,7 +3053,7 @@ impl<T: Read> Read for Take<T> {
             // The condition above guarantees that `self.limit` fits in `usize`.
             let limit = self.limit as usize;
 
-            let extra_init = cmp::min(limit, buf.init_ref().len());
+            let extra_init = cmp::min(limit, buf.init_mut().len());
 
             // SAFETY: no uninit data is written to ibuf
             let ibuf = unsafe { &mut buf.as_mut()[..limit] };
@@ -3068,7 +3068,7 @@ impl<T: Read> Read for Take<T> {
             let mut cursor = sliced_buf.unfilled();
             let result = self.inner.read_buf(cursor.reborrow());
 
-            let new_init = cursor.init_ref().len();
+            let new_init = cursor.init_mut().len();
             let filled = sliced_buf.len();
 
             // cursor / sliced_buf / ibuf must drop here