File tree 3 files changed +3
-12
lines changed
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 {
407
407
// called via generated `__rust_alloc_error_handler` if there is no
408
408
// `#[alloc_error_handler]`.
409
409
#[ rustc_std_internal_symbol]
410
- pub unsafe fn __rdl_oom ( size : usize , _align : usize ) -> ! {
410
+ pub fn __rdl_oom ( size : usize , _align : usize ) -> ! {
411
411
extern "Rust" {
412
412
// This symbol is emitted by rustc next to __rust_alloc_error_handler.
413
413
// 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) {
344
344
}
345
345
346
346
fn 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 ( ) ) ;
358
348
}
359
349
360
350
#[ cfg( not( test) ) ]
Original file line number Diff line number Diff line change 362
362
// Library features (alloc):
363
363
// tidy-alphabetical-start
364
364
#![ feature( alloc_layout_extra) ]
365
+ #![ feature( alloc_internals) ]
365
366
#![ feature( allocator_api) ]
366
367
#![ feature( get_mut_unchecked) ]
367
368
#![ feature( map_try_insert) ]
You can’t perform that action at this time.
0 commit comments