Skip to content

Commit 3b0a02a

Browse files
authored
Rollup merge of #82862 - athre0z:generalize-vec-write-impl, r=TimDiekmann
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 impl for allocator support was most likely just forgotten previously. This PR fixes this. r? `````@TimDiekmann````` [1]: rust-lang/wg-allocators#86
2 parents 08475e7 + ab8995b commit 3b0a02a

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)