summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2020-05-19 00:54:23 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2020-05-19 00:54:23 +0200
commit85d52f3db69126ad9d374f03e32c22fded058570 (patch)
treee5b496ca74d01d0b3e56853181009549b1b76b0f /src
parentacafb83a63b4f99b3340b84d8e1ea3ba267bd80a (diff)
downloadneco-85d52f3db69126ad9d374f03e32c22fded058570.tar
neco-85d52f3db69126ad9d374f03e32c22fded058570.zip
Fix --all-targets build
Diffstat (limited to 'src')
-rw-r--r--src/main.rs1
-rw-r--r--src/system_alloc.rs1
2 files changed, 2 insertions, 0 deletions
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");