@@ -93,7 +93,7 @@ impl<T, A: Alloc> RawVec<T, A> {
9393
9494 // handles ZSTs and `cap = 0` alike
9595 let ptr = if alloc_size == 0 {
96- NonNull :: < T > :: dangling ( ) . as_opaque ( )
96+ NonNull :: < T > :: dangling ( ) . cast ( )
9797 } else {
9898 let align = mem:: align_of :: < T > ( ) ;
9999 let layout = Layout :: from_size_align ( alloc_size, align) . unwrap ( ) ;
@@ -314,7 +314,7 @@ impl<T, A: Alloc> RawVec<T, A> {
314314 let new_cap = 2 * self . cap ;
315315 let new_size = new_cap * elem_size;
316316 alloc_guard ( new_size) . unwrap_or_else ( |_| capacity_overflow ( ) ) ;
317- let ptr_res = self . a . realloc ( NonNull :: from ( self . ptr ) . as_opaque ( ) ,
317+ let ptr_res = self . a . realloc ( NonNull :: from ( self . ptr ) . cast ( ) ,
318318 cur,
319319 new_size) ;
320320 match ptr_res {
@@ -373,7 +373,7 @@ impl<T, A: Alloc> RawVec<T, A> {
373373 let new_cap = 2 * self . cap ;
374374 let new_size = new_cap * elem_size;
375375 alloc_guard ( new_size) . unwrap_or_else ( |_| capacity_overflow ( ) ) ;
376- match self . a . grow_in_place ( NonNull :: from ( self . ptr ) . as_opaque ( ) , old_layout, new_size) {
376+ match self . a . grow_in_place ( NonNull :: from ( self . ptr ) . cast ( ) , old_layout, new_size) {
377377 Ok ( _) => {
378378 // We can't directly divide `size`.
379379 self . cap = new_cap;
@@ -546,7 +546,7 @@ impl<T, A: Alloc> RawVec<T, A> {
546546 // FIXME: may crash and burn on over-reserve
547547 alloc_guard ( new_layout. size ( ) ) . unwrap_or_else ( |_| capacity_overflow ( ) ) ;
548548 match self . a . grow_in_place (
549- NonNull :: from ( self . ptr ) . as_opaque ( ) , old_layout, new_layout. size ( ) ,
549+ NonNull :: from ( self . ptr ) . cast ( ) , old_layout, new_layout. size ( ) ,
550550 ) {
551551 Ok ( _) => {
552552 self . cap = new_cap;
@@ -607,7 +607,7 @@ impl<T, A: Alloc> RawVec<T, A> {
607607 let new_size = elem_size * amount;
608608 let align = mem:: align_of :: < T > ( ) ;
609609 let old_layout = Layout :: from_size_align_unchecked ( old_size, align) ;
610- match self . a . realloc ( NonNull :: from ( self . ptr ) . as_opaque ( ) ,
610+ match self . a . realloc ( NonNull :: from ( self . ptr ) . cast ( ) ,
611611 old_layout,
612612 new_size) {
613613 Ok ( p) => self . ptr = p. cast ( ) . into ( ) ,
@@ -667,7 +667,7 @@ impl<T, A: Alloc> RawVec<T, A> {
667667 let res = match self . current_layout ( ) {
668668 Some ( layout) => {
669669 debug_assert ! ( new_layout. align( ) == layout. align( ) ) ;
670- self . a . realloc ( NonNull :: from ( self . ptr ) . as_opaque ( ) , layout, new_layout. size ( ) )
670+ self . a . realloc ( NonNull :: from ( self . ptr ) . cast ( ) , layout, new_layout. size ( ) )
671671 }
672672 None => self . a . alloc ( new_layout) ,
673673 } ;
@@ -710,7 +710,7 @@ impl<T, A: Alloc> RawVec<T, A> {
710710 let elem_size = mem:: size_of :: < T > ( ) ;
711711 if elem_size != 0 {
712712 if let Some ( layout) = self . current_layout ( ) {
713- self . a . dealloc ( NonNull :: from ( self . ptr ) . as_opaque ( ) , layout) ;
713+ self . a . dealloc ( NonNull :: from ( self . ptr ) . cast ( ) , layout) ;
714714 }
715715 }
716716 }
0 commit comments