From ab8995bbca73be761402585ead491111163c44d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20Ho=CC=88ner?= Date: Sun, 7 Mar 2021 16:22:53 +0100 Subject: [PATCH] Generalize Write impl for Vec to Vec As discussed in the issue tracker for the wg-allocators working group[1], updating this implementation for allocator support was most likely just forgotten in the original PR. [1]: https://github.com/rust-lang/wg-allocators/issues/86 --- library/std/src/io/impls.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/std/src/io/impls.rs b/library/std/src/io/impls.rs index 00bf8b9af73..9870cfc4c95 100644 --- a/library/std/src/io/impls.rs +++ b/library/std/src/io/impls.rs @@ -1,6 +1,7 @@ #[cfg(test)] mod tests; +use crate::alloc::Allocator; use crate::cmp; use crate::fmt; use crate::io::{ @@ -357,7 +358,7 @@ fn flush(&mut self) -> io::Result<()> { /// Write is implemented for `Vec` by appending to the vector. /// The vector will grow as needed. #[stable(feature = "rust1", since = "1.0.0")] -impl Write for Vec { +impl Write for Vec { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { self.extend_from_slice(buf);