From 85d52f3db69126ad9d374f03e32c22fded058570 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Tue, 19 May 2020 00:54:23 +0200 Subject: Fix --all-targets build --- src/main.rs | 1 + src/system_alloc.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main.rs b/src/main.rs index c6ec961..4283396 100644 --- a/src/main.rs +++ b/src/main.rs @@ -45,6 +45,7 @@ pub extern "C" fn main(_nargs: libc::c_int, _args: *const *const libc::c_char) - 0 } +#[cfg(not(test))] #[panic_handler] fn panic(info: &core::panic::PanicInfo) -> ! { let _ = writeln!(libc::stdio::stderr(), "Panic: {}", info); diff --git a/src/system_alloc.rs b/src/system_alloc.rs index ad1afcb..7c0bac9 100644 --- a/src/system_alloc.rs +++ b/src/system_alloc.rs @@ -15,6 +15,7 @@ unsafe impl alloc::alloc::GlobalAlloc for System { #[global_allocator] static SYSTEM_ALLOC: System = System; +#[cfg(not(test))] #[alloc_error_handler] fn alloc_error(_: core::alloc::Layout) -> ! { panic!("allocation failure"); -- cgit v1.2.3