File tree Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Expand file tree Collapse file tree 3 files changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ pub mod __alloc_error_handler {
407407    // called via generated `__rust_alloc_error_handler` if there is no 
408408    // `#[alloc_error_handler]`. 
409409    #[ rustc_std_internal_symbol]  
410-     pub  unsafe   fn  __rdl_oom ( size :  usize ,  _align :  usize )  -> ! { 
410+     pub  fn  __rdl_oom ( size :  usize ,  _align :  usize )  -> ! { 
411411        extern  "Rust"  { 
412412            // This symbol is emitted by rustc next to __rust_alloc_error_handler. 
413413            // Its value depends on the -Zoom={panic,abort} compiler option. 
Original file line number Diff line number Diff line change @@ -344,17 +344,7 @@ pub fn take_alloc_error_hook() -> fn(Layout) {
344344} 
345345
346346fn  default_alloc_error_hook ( layout :  Layout )  { 
347-     extern  "Rust"  { 
348-         // This symbol is emitted by rustc next to __rust_alloc_error_handler. 
349-         // Its value depends on the -Zoom={panic,abort} compiler option. 
350-         static  __rust_alloc_error_handler_should_panic:  u8 ; 
351-     } 
352- 
353-     if  unsafe  {  __rust_alloc_error_handler_should_panic != 0  }  { 
354-         panic ! ( "memory allocation of {} bytes failed" ,  layout. size( ) ) ; 
355-     }  else  { 
356-         rtprintpanic ! ( "memory allocation of {} bytes failed\n " ,  layout. size( ) ) ; 
357-     } 
347+     alloc:: alloc:: __alloc_error_handler:: __rdl_oom ( layout. size ( ) ,  layout. align ( ) ) ; 
358348} 
359349
360350#[ cfg( not( test) ) ]  
Original file line number Diff line number Diff line change 362362// Library features (alloc): 
363363// tidy-alphabetical-start 
364364#![ feature( alloc_layout_extra) ]  
365+ #![ feature( alloc_internals) ]  
365366#![ feature( allocator_api) ]  
366367#![ feature( get_mut_unchecked) ]  
367368#![ feature( map_try_insert) ]  
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments