Skip to content

Commit 4c4dec4

Browse files
authored
Rollup merge of #105126 - Sp00ph:const_new_in, r=dtolnay
Make `VecDeque::new_in` unstably const (See #105072)
2 parents 4fdc3eb + c959fbe commit 4c4dec4

File tree

1 file changed

+2
-3
lines changed
  • library/alloc/src/collections/vec_deque

1 file changed

+2
-3
lines changed

library/alloc/src/collections/vec_deque/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -566,10 +566,9 @@ impl<T, A: Allocator> VecDeque<T, A> {
566566
///
567567
/// let deque: VecDeque<u32> = VecDeque::new();
568568
/// ```
569-
// FIXME: This should probably be const
570569
#[inline]
571570
#[unstable(feature = "allocator_api", issue = "32838")]
572-
pub fn new_in(alloc: A) -> VecDeque<T, A> {
571+
pub const fn new_in(alloc: A) -> VecDeque<T, A> {
573572
VecDeque { head: 0, len: 0, buf: RawVec::new_in(alloc) }
574573
}
575574

@@ -2152,7 +2151,7 @@ impl<T, A: Allocator> VecDeque<T, A> {
21522151

21532152
self.head = tail;
21542153
} else {
2155-
// ´free` is smaller than both `head_len` and `tail_len`.
2154+
// `free` is smaller than both `head_len` and `tail_len`.
21562155
// the general algorithm for this first moves the slices
21572156
// right next to each other and then uses `slice::rotate`
21582157
// to rotate them into place:

0 commit comments

Comments
 (0)