-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
$ cargo create --lib foo
$ cd foo
$ cat >> Cargo.toml <<EOF
[lib]
crate-type = ["rlib", "staticlib"]
[profile.dev]
panic="abort"
EOF
$ cat > src/lib.rs <<EOF
#![cfg_attr(not(test), no_std)]
#![feature(lang_items)]
#[cfg(not(test))]
#[lang = "panic_fmt"]
#[no_mangle]
pub fn panic_fmt(_: core::fmt::Arguments, _: &'static str, _: u32, _: u32) -> ! {
loop {}
}
EOF
$ cargo +nightly build
Compiling foo v0.1.0 (file:///tmp/foo)
Finished dev [unoptimized + debuginfo] target(s) in 0.13 secs
$ cargo +nightly test
Compiling foo v0.1.0 (file:///tmp/foo)
error: language item required, but not found: `eh_personality`
error: aborting due to previous error
That is an error that is expected with no_std
, but the code is supposed to be essentially empty in the test
configuration.
It works when crate-type
contains only one value (either one).
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.