|
69 | 69 | //! [`vec!`]: ../macro.vec.html |
70 | 70 |
|
71 | 71 | use crate::{ |
72 | | - alloc::{AllocRef, BuildAllocRef, DeallocRef, Global, PanicAdapter, ReallocRef}, |
| 72 | + alloc::{AllocRef, BuildAllocRef, DeallocRef, Global, AbortAlloc, ReallocRef}, |
73 | 73 | boxed::Box, |
74 | 74 | clone::CloneIn, |
75 | 75 | collections::CollectionAllocErr, |
@@ -328,7 +328,7 @@ use core::{ |
328 | 328 | /// [`insert`]: Self::insert() |
329 | 329 | /// [`reserve`]: Self::reserve |
330 | 330 | /// [owned slice]: crate::boxed::Box |
331 | | -pub struct Vec<T, A: DeallocRef = PanicAdapter<Global>> { |
| 331 | +pub struct Vec<T, A: DeallocRef = AbortAlloc<Global>> { |
332 | 332 | buf: RawVec<T, A>, |
333 | 333 | len: usize, |
334 | 334 | } |
@@ -401,7 +401,7 @@ impl<T> Vec<T> { |
401 | 401 | #[inline] |
402 | 402 | #[must_use] |
403 | 403 | pub fn with_capacity(capacity: usize) -> Self { |
404 | | - Self::with_capacity_in(capacity, PanicAdapter(Global)) |
| 404 | + Self::with_capacity_in(capacity, AbortAlloc(Global)) |
405 | 405 | } |
406 | 406 |
|
407 | 407 | /// Creates a `Vec<T>` directly from the raw components of another vector. |
@@ -664,7 +664,7 @@ impl<T, A: DeallocRef> Vec<T, A> { |
664 | 664 | /// # Examples |
665 | 665 | /// |
666 | 666 | /// ``` |
667 | | - /// use alloc_wg::{alloc::PanicAdapter<Global>, collections::CollectionAllocErr, vec::Vec}; |
| 667 | + /// use alloc_wg::{alloc::AbortAlloc<Global>, collections::CollectionAllocErr, vec::Vec}; |
668 | 668 | /// |
669 | 669 | /// fn process_data(data: &[u32]) -> Result<Vec<u32>, CollectionAllocErr<Global>> { |
670 | 670 | /// let mut output = Vec::new(); |
@@ -2037,7 +2037,7 @@ impl<T: PartialEq, A: DeallocRef> Vec<T, A> { |
2037 | 2037 |
|
2038 | 2038 | #[doc(hidden)] |
2039 | 2039 | pub fn from_elem<T: Clone>(elem: T, n: usize) -> Vec<T> { |
2040 | | - from_elem_in(elem, n, PanicAdapter(Global)) |
| 2040 | + from_elem_in(elem, n, AbortAlloc(Global)) |
2041 | 2041 | } |
2042 | 2042 |
|
2043 | 2043 | #[doc(hidden)] |
@@ -2280,9 +2280,9 @@ impl<T> FromIterator<T> for Vec<T> { |
2280 | 2280 | #[inline] |
2281 | 2281 | #[must_use] |
2282 | 2282 | fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self { |
2283 | | - <Self as SpecExtend<T, I::IntoIter, PanicAdapter<Global>>>::from_iter_in( |
| 2283 | + <Self as SpecExtend<T, I::IntoIter, AbortAlloc<Global>>>::from_iter_in( |
2284 | 2284 | iter.into_iter(), |
2285 | | - PanicAdapter(Global), |
| 2285 | + AbortAlloc(Global), |
2286 | 2286 | ) |
2287 | 2287 | } |
2288 | 2288 | } |
@@ -2923,7 +2923,7 @@ impl From<&str> for Vec<u8> { |
2923 | 2923 | /// |
2924 | 2924 | /// [`Vec`]: struct.Vec.html |
2925 | 2925 | /// [`IntoIterator`]: ../../std/iter/trait.IntoIterator.html |
2926 | | -pub struct IntoIter<T, A: DeallocRef = PanicAdapter<Global>> { |
| 2926 | +pub struct IntoIter<T, A: DeallocRef = AbortAlloc<Global>> { |
2927 | 2927 | buf: RawVec<T, A>, |
2928 | 2928 | ptr: *const T, |
2929 | 2929 | end: *const T, |
@@ -3069,7 +3069,7 @@ impl<T, A: DeallocRef> Drop for IntoIter<T, A> { |
3069 | 3069 | /// |
3070 | 3070 | /// [`drain`]: struct.Vec.html#method.drain |
3071 | 3071 | /// [`Vec`]: struct.Vec.html |
3072 | | -pub struct Drain<'a, T, A: DeallocRef = PanicAdapter<Global>> { |
| 3072 | +pub struct Drain<'a, T, A: DeallocRef = AbortAlloc<Global>> { |
3073 | 3073 | /// Index of tail to preserve |
3074 | 3074 | tail_start: usize, |
3075 | 3075 | /// Length of tail |
@@ -3162,7 +3162,7 @@ impl<T, A: DeallocRef> FusedIterator for Drain<'_, T, A> {} |
3162 | 3162 | /// [`splice()`]: struct.Vec.html#method.splice |
3163 | 3163 | /// [`Vec`]: struct.Vec.html |
3164 | 3164 | #[derive(Debug)] |
3165 | | -pub struct Splice<'a, I: Iterator + 'a, A = PanicAdapter<Global>> |
| 3165 | +pub struct Splice<'a, I: Iterator + 'a, A = AbortAlloc<Global>> |
3166 | 3166 | where |
3167 | 3167 | A: ReallocRef<Error = !>, // Because Drop can allocate |
3168 | 3168 | { |
@@ -3284,7 +3284,7 @@ where |
3284 | 3284 |
|
3285 | 3285 | /// An iterator produced by calling `drain_filter` on Vec. |
3286 | 3286 | // #[derive(Debug)] |
3287 | | -pub struct DrainFilter<'a, T, F, A: DeallocRef = PanicAdapter<Global>> |
| 3287 | +pub struct DrainFilter<'a, T, F, A: DeallocRef = AbortAlloc<Global>> |
3288 | 3288 | where |
3289 | 3289 | F: FnMut(&mut T) -> bool, |
3290 | 3290 | { |
@@ -3347,7 +3347,7 @@ where |
3347 | 3347 | F: FnMut(&mut T) -> bool, |
3348 | 3348 | { |
3349 | 3349 | fn drop(&mut self) { |
3350 | | - struct BackshiftOnDrop<'a, 'b, T, F, A: DeallocRef = PanicAdapter<Global>> |
| 3350 | + struct BackshiftOnDrop<'a, 'b, T, F, A: DeallocRef = AbortAlloc<Global>> |
3351 | 3351 | where |
3352 | 3352 | F: FnMut(&mut T) -> bool, |
3353 | 3353 | { |
|
0 commit comments