From 9c4d057e3d64a0c59373534947df45cfdb356b12 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Tue, 15 Sep 2015 14:44:37 +0200 Subject: [PATCH] Don't implement lang items on testing The `std` library is imported on testing. It already implements all lang items. --- src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index b1984d03..676ce844 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -37,5 +37,10 @@ pub extern fn rust_main() { loop{} } -#[lang = "eh_personality"] extern fn eh_personality() {} -#[lang = "panic_fmt"] extern fn panic_fmt() -> ! {loop{}} +#[cfg(not(test))] +#[lang = "eh_personality"] +extern fn eh_personality() {} + +#[cfg(not(test))] +#[lang = "panic_fmt"] +extern fn panic_fmt() -> ! {loop{}}