src/lib.rs:
#![no_std]
#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop {}
}
Cargo.toml:
[package]
name = "panic_test"
version = "0.1.0"
authors = ["..."]
edition = "2018"
[lib]
crate-type = ["staticlib"]
If you build this with the stable compiler (tried with 1.45.0) you'll see this error:
error: language item required, but not found: `eh_personality`
error: aborting due to previous error
error: could not compile `panic_test`.
However there's no way of adding eh_personality
as that requires lang_items
feature.
So it seems like there's no way of generating a static library form a no_std Rust crate using stable compiler. Am I missing anything?