-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.O-appleOperating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.
Description
Code
I tried this code:
// src/main.rs
unsafe extern "C" {
unsafe static UNDEFINED: usize;
}
#[unsafe(no_mangle)]
pub fn used() {
println!("UNDEFINED = {}", unsafe { UNDEFINED });
}
pub fn marker() -> usize {
0
}
fn main() {
assert_eq!(marker(), 0_usize);
}
cargo build --target aarch64-apple-darwin
I expected to see this happen: it builds
Instead, this happened: it emits linker errors
Version it worked on
1.86.0
Version with regression
nightly-2025-02-26; bisects to #133832
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-bugCategory: This is a bug.Category: This is a bug.O-appleOperating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)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.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.Performance or correctness regression from stable to beta.