Fix --all-targets build

This commit is contained in:
Matthias Schiffer 2020-05-19 00:54:23 +02:00
parent acafb83a63
commit 85d52f3db6
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
2 changed files with 2 additions and 0 deletions

View file

@ -45,6 +45,7 @@ pub extern "C" fn main(_nargs: libc::c_int, _args: *const *const libc::c_char) -
0 0
} }
#[cfg(not(test))]
#[panic_handler] #[panic_handler]
fn panic(info: &core::panic::PanicInfo) -> ! { fn panic(info: &core::panic::PanicInfo) -> ! {
let _ = writeln!(libc::stdio::stderr(), "Panic: {}", info); let _ = writeln!(libc::stdio::stderr(), "Panic: {}", info);

View file

@ -15,6 +15,7 @@ unsafe impl alloc::alloc::GlobalAlloc for System {
#[global_allocator] #[global_allocator]
static SYSTEM_ALLOC: System = System; static SYSTEM_ALLOC: System = System;
#[cfg(not(test))]
#[alloc_error_handler] #[alloc_error_handler]
fn alloc_error(_: core::alloc::Layout) -> ! { fn alloc_error(_: core::alloc::Layout) -> ! {
panic!("allocation failure"); panic!("allocation failure");