@@ -222,7 +222,7 @@ for hacking!
222222
223223#![ deny( missing_docs) ]
224224#![ cfg_attr( not( feature = "use_std_for_test_debugging" ) , no_std) ]
225- #![ feature( alloc, allocator_api, core_intrinsics, global_allocator ) ]
225+ #![ feature( alloc, allocator_api, core_intrinsics) ]
226226#![ cfg_attr( target_arch = "wasm32" , feature( link_llvm_intrinsics) ) ]
227227
228228#[ macro_use]
@@ -269,7 +269,7 @@ mod neighbors;
269269mod size_classes;
270270
271271use const_init:: ConstInit ;
272- use core:: alloc:: { Alloc , AllocErr , GlobalAlloc , Layout , Opaque } ;
272+ use core:: alloc:: { Alloc , AllocErr , GlobalAlloc , Layout } ;
273273use core:: cell:: Cell ;
274274use core:: cmp;
275275use core:: marker:: Sync ;
@@ -520,7 +520,7 @@ impl<'a> FreeCell<'a> {
520520 }
521521
522522 unsafe fn from_uninitialized (
523- raw : NonNull < Opaque > ,
523+ raw : NonNull < u8 > ,
524524 size : Bytes ,
525525 next_free : Option < * const FreeCell < ' a > > ,
526526 policy : & AllocPolicy < ' a > ,
@@ -586,7 +586,7 @@ impl<'a> FreeCell<'a> {
586586 let split_cell_head = split_and_aligned - size_of :: < CellHeader > ( ) . 0 ;
587587 let split_cell = unsafe {
588588 & * FreeCell :: from_uninitialized (
589- unchecked_unwrap ( NonNull :: new ( split_cell_head as * mut Opaque ) ) ,
589+ unchecked_unwrap ( NonNull :: new ( split_cell_head as * mut u8 ) ) ,
590590 Bytes ( next - split_cell_head) - size_of :: < CellHeader > ( ) ,
591591 None ,
592592 policy,
@@ -951,7 +951,7 @@ unsafe fn alloc_first_fit<'a>(
951951 align : Bytes ,
952952 head : & Cell < * const FreeCell < ' a > > ,
953953 policy : & AllocPolicy < ' a > ,
954- ) -> Result < NonNull < Opaque > , AllocErr > {
954+ ) -> Result < NonNull < u8 > , AllocErr > {
955955 extra_assert ! ( size. 0 > 0 ) ;
956956
957957 walk_free_list ( head, policy, |previous, current| {
@@ -960,7 +960,7 @@ unsafe fn alloc_first_fit<'a>(
960960 if let Some ( allocated) = current. try_alloc ( previous, size, align, policy) {
961961 assert_aligned_to ( allocated. data ( ) , align) ;
962962 return Some ( unchecked_unwrap (
963- NonNull :: new ( allocated. data ( ) as * mut Opaque ) ,
963+ NonNull :: new ( allocated. data ( ) as * mut u8 ) ,
964964 ) ) ;
965965 }
966966
@@ -973,7 +973,7 @@ unsafe fn alloc_with_refill<'a, 'b>(
973973 align : Bytes ,
974974 head : & ' b Cell < * const FreeCell < ' a > > ,
975975 policy : & AllocPolicy < ' a > ,
976- ) -> Result < NonNull < Opaque > , AllocErr > {
976+ ) -> Result < NonNull < u8 > , AllocErr > {
977977 if let Ok ( result) = alloc_first_fit ( size, align, head, policy) {
978978 return Ok ( result) ;
979979 }
@@ -1072,7 +1072,7 @@ unsafe impl<'a, 'b> Alloc for &'b WeeAlloc<'a>
10721072where
10731073 ' a : ' b ,
10741074{
1075- unsafe fn alloc ( & mut self , layout : Layout ) -> Result < NonNull < Opaque > , AllocErr > {
1075+ unsafe fn alloc ( & mut self , layout : Layout ) -> Result < NonNull < u8 > , AllocErr > {
10761076 let size = Bytes ( layout. size ( ) ) ;
10771077 let align = if layout. align ( ) == 0 {
10781078 Bytes ( 1 )
@@ -1084,7 +1084,7 @@ where
10841084 // Ensure that our made up pointer is properly aligned by using the
10851085 // alignment as the pointer.
10861086 extra_assert ! ( align. 0 > 0 ) ;
1087- return Ok ( NonNull :: new_unchecked ( align. 0 as * mut Opaque ) ) ;
1087+ return Ok ( NonNull :: new_unchecked ( align. 0 as * mut u8 ) ) ;
10881088 }
10891089
10901090 let size: Words = size. round_up_to ( ) ;
@@ -1095,7 +1095,7 @@ where
10951095 } )
10961096 }
10971097
1098- unsafe fn dealloc ( & mut self , ptr : NonNull < Opaque > , layout : Layout ) {
1098+ unsafe fn dealloc ( & mut self , ptr : NonNull < u8 > , layout : Layout ) {
10991099 let size = Bytes ( layout. size ( ) ) ;
11001100 if size. 0 == 0 {
11011101 return ;
@@ -1185,15 +1185,15 @@ where
11851185}
11861186
11871187unsafe impl GlobalAlloc for WeeAlloc < ' static > {
1188- unsafe fn alloc ( & self , layout : Layout ) -> * mut Opaque {
1188+ unsafe fn alloc ( & self , layout : Layout ) -> * mut u8 {
11891189 let mut me = self ;
11901190 match Alloc :: alloc ( & mut me, layout) {
11911191 Ok ( ptr) => ptr. as_ptr ( ) ,
1192- Err ( AllocErr ) => 0 as * mut Opaque ,
1192+ Err ( AllocErr ) => 0 as * mut u8 ,
11931193 }
11941194 }
11951195
1196- unsafe fn dealloc ( & self , ptr : * mut Opaque , layout : Layout ) {
1196+ unsafe fn dealloc ( & self , ptr : * mut u8 , layout : Layout ) {
11971197 if let Some ( ptr) = NonNull :: new ( ptr) {
11981198 let mut me = self ;
11991199 Alloc :: dealloc ( & mut me, ptr, layout) ;
0 commit comments