79
79
//! [`NonZeroLayout::for_value(&*value)`]: crate::alloc::NonZeroLayout::for_value
80
80
81
81
use crate :: {
82
- alloc:: { AbortAlloc , AllocRef , BuildAllocRef , DeallocRef , Global , NonZeroLayout } ,
82
+ alloc:: { AbortAlloc , AllocRef , BuildAllocRef , DeallocRef , Global , NonZeroLayout , Panic } ,
83
83
clone:: CloneIn ,
84
84
collections:: CollectionAllocErr ,
85
85
raw_vec:: RawVec ,
@@ -188,7 +188,7 @@ impl<T, A: AllocRef> Box<T, A> {
188
188
#[ inline( always) ]
189
189
pub fn new_in ( x : T , a : A ) -> Self
190
190
where
191
- A : AllocRef < Error = ! > ,
191
+ A : AllocRef < Error = Panic > ,
192
192
{
193
193
let Ok ( b) = Self :: try_new_in ( x, a) ;
194
194
b
@@ -245,7 +245,7 @@ impl<T, A: AllocRef> Box<T, A> {
245
245
#[ inline( always) ]
246
246
pub fn new_uninit_in ( a : A ) -> Box < mem:: MaybeUninit < T > , A >
247
247
where
248
- A : AllocRef < Error = ! > ,
248
+ A : AllocRef < Error = Panic > ,
249
249
{
250
250
let Ok ( b) = Self :: try_new_uninit_in ( a) ;
251
251
b
@@ -286,7 +286,7 @@ impl<T, A: AllocRef> Box<T, A> {
286
286
#[ inline( always) ]
287
287
pub fn pin_in ( x : T , a : A ) -> Pin < Self >
288
288
where
289
- A : AllocRef < Error = ! > ,
289
+ A : AllocRef < Error = Panic > ,
290
290
{
291
291
let Ok ( b) = Self :: try_pin_in ( x, a) ;
292
292
b
@@ -331,7 +331,7 @@ impl<T> Box<[T]> {
331
331
}
332
332
333
333
#[ allow( clippy:: use_self) ]
334
- impl < T , A : AllocRef < Error = ! > > Box < [ T ] , A > {
334
+ impl < T , A : AllocRef < Error = Panic > > Box < [ T ] , A > {
335
335
/// Construct a new boxed slice with uninitialized contents with the spoecified allocator.
336
336
///
337
337
/// # Example
@@ -775,7 +775,7 @@ unsafe impl<#[may_dangle] T: ?Sized, A: DeallocRef> Drop for Box<T, A> {
775
775
impl < T , A > Default for Box < T , A >
776
776
where
777
777
T : Default ,
778
- A : Default + AllocRef < Error = ! > ,
778
+ A : Default + AllocRef < Error = Panic > ,
779
779
{
780
780
#[ must_use]
781
781
fn default ( ) -> Self {
@@ -784,9 +784,9 @@ where
784
784
}
785
785
786
786
#[ allow( clippy:: use_self) ]
787
- impl < T , A : AllocRef < Error = ! > > Default for Box < [ T ] , A >
787
+ impl < T , A : AllocRef < Error = Panic > > Default for Box < [ T ] , A >
788
788
where
789
- A : Default + AllocRef < Error = ! > ,
789
+ A : Default + AllocRef < Error = Panic > ,
790
790
{
791
791
#[ must_use]
792
792
fn default ( ) -> Self {
@@ -801,19 +801,19 @@ unsafe fn from_boxed_utf8_unchecked<A: DeallocRef>(v: Box<[u8], A>) -> Box<str,
801
801
}
802
802
803
803
#[ allow( clippy:: use_self) ]
804
- impl < A : AllocRef < Error = ! > > Default for Box < str , A >
804
+ impl < A : AllocRef < Error = Panic > > Default for Box < str , A >
805
805
where
806
- A : Default + AllocRef < Error = ! > ,
806
+ A : Default + AllocRef < Error = Panic > ,
807
807
{
808
808
#[ must_use]
809
809
fn default ( ) -> Self {
810
810
unsafe { from_boxed_utf8_unchecked ( Box :: default ( ) ) }
811
811
}
812
812
}
813
813
814
- impl < T : Clone , A : AllocRef < Error = ! > > Clone for Box < T , A >
814
+ impl < T : Clone , A : AllocRef < Error = Panic > > Clone for Box < T , A >
815
815
where
816
- A : AllocRef < Error = ! > ,
816
+ A : AllocRef < Error = Panic > ,
817
817
A :: BuildAlloc : Clone ,
818
818
{
819
819
/// Returns a new box with a `clone()` of this box's contents.
@@ -876,7 +876,7 @@ impl<T: Clone, A: AllocRef, B: AllocRef> CloneIn<B> for Box<T, A> {
876
876
877
877
fn clone_in ( & self , a : B ) -> Self :: Cloned
878
878
where
879
- B : AllocRef < Error = ! > ,
879
+ B : AllocRef < Error = Panic > ,
880
880
{
881
881
Box :: new_in ( self . as_ref ( ) . clone ( ) , a)
882
882
}
@@ -978,9 +978,9 @@ impl<T: ?Sized + Hasher, A: DeallocRef> Hasher for Box<T, A> {
978
978
}
979
979
}
980
980
981
- impl < T , A : AllocRef < Error = ! > > From < T > for Box < T , A >
981
+ impl < T , A : AllocRef < Error = Panic > > From < T > for Box < T , A >
982
982
where
983
- A : Default + AllocRef < Error = ! > ,
983
+ A : Default + AllocRef < Error = Panic > ,
984
984
{
985
985
/// Converts a generic type `T` into a `Box<T>`
986
986
///
@@ -1014,7 +1014,7 @@ impl<T: ?Sized, A: DeallocRef> From<Box<T, A>> for Pin<Box<T, A>> {
1014
1014
#[ allow( clippy:: use_self) ]
1015
1015
impl < T : Copy , A > From < & [ T ] > for Box < [ T ] , A >
1016
1016
where
1017
- A : Default + AllocRef < Error = ! > ,
1017
+ A : Default + AllocRef < Error = Panic > ,
1018
1018
{
1019
1019
/// Converts a `&[T]` into a `Box<[T], B>`
1020
1020
///
@@ -1043,7 +1043,7 @@ where
1043
1043
#[ allow( clippy:: use_self) ]
1044
1044
impl < A > From < & str > for Box < str , A >
1045
1045
where
1046
- A : Default + AllocRef < Error = ! > ,
1046
+ A : Default + AllocRef < Error = Panic > ,
1047
1047
{
1048
1048
/// Converts a `&str` into a `Box<str>`
1049
1049
///
@@ -1306,7 +1306,7 @@ impl_dispatch_from_dyn!(AbortAlloc<std::alloc::System>);
1306
1306
#[ allow( clippy:: items_after_statements) ]
1307
1307
impl < T : Clone , A : Clone > Clone for Box < [ T ] , A >
1308
1308
where
1309
- A : AllocRef < Error = ! > ,
1309
+ A : AllocRef < Error = Panic > ,
1310
1310
A :: BuildAlloc : Clone ,
1311
1311
{
1312
1312
fn clone ( & self ) -> Self {
0 commit comments