Skip to content

Commit 59708b4

Browse files
committed
Plumb Allocator generic into std::vec::PeekMut
1 parent 9d82de1 commit 59708b4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

library/alloc/src/vec/peek_mut.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use core::ops::{Deref, DerefMut};
22

33
use super::Vec;
4+
use crate::alloc::{Allocator, Global};
45
use crate::fmt;
56

67
/// Structure wrapping a mutable reference to the last item in a
@@ -11,8 +12,12 @@ use crate::fmt;
1112
///
1213
/// [`peek_mut`]: Vec::peek_mut
1314
#[unstable(feature = "vec_peek_mut", issue = "122742")]
14-
pub struct PeekMut<'a, T> {
15-
vec: &'a mut Vec<T>,
15+
pub struct PeekMut<
16+
'a,
17+
T,
18+
#[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
19+
> {
20+
vec: &'a mut Vec<T, A>,
1621
}
1722

1823
#[unstable(feature = "vec_peek_mut", issue = "122742")]

0 commit comments

Comments
 (0)