diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-12-02 08:28:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-02 08:28:09 +0100 |
| commit | 4c4dec440837cc9dc3287c5d1ba20def25d11838 (patch) | |
| tree | 2d5f737f6bef4f548eb55eb0471a1ae2e8d3d876 | |
| parent | 4fdc3eb1761ee50961e4da67b7ccda9d971f5f20 (diff) | |
| parent | c959fbe771b5f1f7d8473805bb17e988c54d45d3 (diff) | |
| download | rust-4c4dec440837cc9dc3287c5d1ba20def25d11838.tar.gz rust-4c4dec440837cc9dc3287c5d1ba20def25d11838.zip | |
Rollup merge of #105126 - Sp00ph:const_new_in, r=dtolnay
Make `VecDeque::new_in` unstably const (See #105072)
| -rw-r--r-- | library/alloc/src/collections/vec_deque/mod.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/library/alloc/src/collections/vec_deque/mod.rs b/library/alloc/src/collections/vec_deque/mod.rs index 86d77182bcc..ee8032ad6f0 100644 --- a/library/alloc/src/collections/vec_deque/mod.rs +++ b/library/alloc/src/collections/vec_deque/mod.rs @@ -566,10 +566,9 @@ impl<T, A: Allocator> VecDeque<T, A> { /// /// let deque: VecDeque<u32> = VecDeque::new(); /// ``` - // FIXME: This should probably be const #[inline] #[unstable(feature = "allocator_api", issue = "32838")] - pub fn new_in(alloc: A) -> VecDeque<T, A> { + pub const fn new_in(alloc: A) -> VecDeque<T, A> { VecDeque { head: 0, len: 0, buf: RawVec::new_in(alloc) } } @@ -2152,7 +2151,7 @@ impl<T, A: Allocator> VecDeque<T, A> { self.head = tail; } else { - // ´free` is smaller than both `head_len` and `tail_len`. + // `free` is smaller than both `head_len` and `tail_len`. // the general algorithm for this first moves the slices // right next to each other and then uses `slice::rotate` // to rotate them into place: |
