Skip to content

Commit ab8995b

Browse files
committed
Generalize Write impl for Vec<u8> to Vec<u8, A>
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]: rust-lang/wg-allocators#86
1 parent 66ec64c commit ab8995b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/std/src/io/impls.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#[cfg(test)]
22
mod tests;
33

4+
use crate::alloc::Allocator;
45
use crate::cmp;
56
use crate::fmt;
67
use crate::io::{
@@ -357,7 +358,7 @@ impl Write for &mut [u8] {
357358
/// Write is implemented for `Vec<u8>` by appending to the vector.
358359
/// The vector will grow as needed.
359360
#[stable(feature = "rust1", since = "1.0.0")]
360-
impl Write for Vec<u8> {
361+
impl<A: Allocator> Write for Vec<u8, A> {
361362
#[inline]
362363
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
363364
self.extend_from_slice(buf);

0 commit comments

Comments
 (0)