(if this issue is better suited to rust-lang/rust, please let me know and I'll post it there)
Problem
cargo check and cargo build behave differently when handling two identically-named #[no_mangle] static values defined in different modules. cargo check incorrectly succeeds without detecting any issues, while cargo build correctly throws a "symbol has already been defined" error.
Steps
- Copy the snippet below these instructions into a new project
- Execute
cargo check, observe incorrect success
- Execute
cargo build, observe correct compiler error
mod other {
#[no_mangle]
pub static ITSBROKEN: u8 = 0;
}
#[no_mangle]
pub static ITSBROKEN: u8 = 0;
Notes
Output of cargo version: cargo 1.36.0 (c4fcfb725 2019-05-15)
Target: x86_64-unknown-linux-gnu
Linux distribution: Fedora 30 (fully updated)
(if this issue is better suited to rust-lang/rust, please let me know and I'll post it there)
Problem
cargo checkandcargo buildbehave differently when handling two identically-named#[no_mangle]static values defined in different modules.cargo checkincorrectly succeeds without detecting any issues, whilecargo buildcorrectly throws a "symbol has already been defined" error.Steps
cargo check, observe incorrect successcargo build, observe correct compiler errorNotes
Output of
cargo version: cargo 1.36.0 (c4fcfb725 2019-05-15)Target: x86_64-unknown-linux-gnu
Linux distribution: Fedora 30 (fully updated)