-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Regression: #[no_mangle] symbols duplicated during test compilation starting nightly-2025-08-15 #145616
Copy link
Copy link
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.P-mediumMedium priorityMedium priorityT-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-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Milestone
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleI-lang-radarItems that are on lang's radar and will need eventual work or consideration.Items that are on lang's radar and will need eventual work or consideration.P-mediumMedium priorityMedium priorityT-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-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Code
I tried this code (simplified from my library):
I expected to see this happen: Successful compilation during
cargo testInstead, this happened: Linker errors with duplicate symbols for
#[no_mangle]functionsVersion it worked on
It most recently worked on: nightly-2025-08-14
Version with regression
rustc +nightly -vV:Backtrace
Backtrace
Additional Information
cargo testin debug mode,cargo builddoesn't fail.alloc/stdenabled.#[cfg(not(test))]to#[no_mangle]functions