-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed as not planned
Closed as not planned
Copy link
Labels
A-metadataArea: Crate metadataArea: Crate metadataT-cargoRelevant to the cargo team, which will review and decide on the PR/issue.Relevant to the cargo team, which will review and decide on the PR/issue.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
(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)
Metadata
Metadata
Assignees
Labels
A-metadataArea: Crate metadataArea: Crate metadataT-cargoRelevant to the cargo team, which will review and decide on the PR/issue.Relevant to the cargo team, which will review and decide on the PR/issue.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.