Skip to content

Commit d7a790f

Browse files
committed
Fix cargo test
1 parent e77e799 commit d7a790f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#![feature(global_asm)]
22
#![feature(lang_items)]
33
#![warn(rust_2018_idioms)]
4+
#![allow(unused_attributes)]
45
#![no_std]
56

67
mod math;
@@ -10,7 +11,8 @@ use core::panic::PanicInfo;
1011
pub use crate::platforms::*;
1112

1213
/// This is the executable start function, which directly follows the entry point.
13-
#[lang = "start"]
14+
#[cfg_attr(not(test), lang = "start")]
15+
#[cfg(not(test))]
1416
extern "C" fn start<T>(user_main: fn() -> T, _argc: isize, _argv: *const *const u8) -> isize
1517
where
1618
T: Termination,
@@ -19,7 +21,7 @@ where
1921
}
2022

2123
/// Termination trait required for the start function.
22-
#[lang = "termination"]
24+
#[cfg_attr(not(test), lang = "termination")]
2325
trait Termination {
2426
fn report(self) -> i32;
2527
}
@@ -32,7 +34,7 @@ impl Termination for () {
3234
}
3335

3436
/// This function is called on panic.
35-
#[panic_handler]
37+
#[cfg_attr(not(test), panic_handler)]
3638
#[no_mangle]
3739
pub fn panic(_info: &PanicInfo<'_>) -> ! {
3840
loop {}

0 commit comments

Comments
 (0)