-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Open
Labels
A-reproducibilityArea: Reproducible / deterministic buildsArea: Reproducible / deterministic buildsC-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow 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.
Description
I am reporting a likely unintended side effect of #142594 that should get compiler team scrutiny.
Since Rust 1.89.0 or nightly-2025-06-23 (#142594), compiling the same source code will produce a different output artifact depending on whether or not standard library sources are present during compilation.
For example, with this src/lib.rs file:
pub fn repro() {
unimplemented!("...")
}$ rustup component remove rust-src --toolchain=nightly-2025-06-22
$ rustc +nightly-2025-06-22 src/lib.rs --crate-name=repro --crate-type=lib --edition=2024 --emit=metadata && rustc +nightly-2025-06-22 -Zls=root librepro.rmeta | rg '^hash'
hash f498d9b8b442661b3b48683256f3913a stable_crate_id StableCrateId(6398988076306807592)
$ rustup component add rust-src --toolchain=nightly-2025-06-22
$ rustc +nightly-2025-06-22 src/lib.rs --crate-name=repro --crate-type=lib --edition=2024 --emit=metadata && rustc +nightly-2025-06-22 -Zls=root librepro.rmeta | rg '^hash'
hash f498d9b8b442661b3b48683256f3913a stable_crate_id StableCrateId(6398988076306807592)$ rustup component remove rust-src --toolchain=nightly-2025-06-23
$ rustc +nightly-2025-06-23 src/lib.rs --crate-name=repro --crate-type=lib --edition=2024 --emit=metadata && rustc +nightly-2025-06-23 -Zls=root librepro.rmeta | rg '^hash'
hash 1e9121fe4158816afef1f8c53f33dabd stable_crate_id StableCrateId(18041666587592679647)
$ rustup component add rust-src --toolchain=nightly-2025-06-23
$ rustc +nightly-2025-06-23 src/lib.rs --crate-name=repro --crate-type=lib --edition=2024 --emit=metadata && rustc +nightly-2025-06-23 -Zls=root librepro.rmeta | rg '^hash'
hash 3bfa9667f7c341fe78b80185c86717eb stable_crate_id StableCrateId(18041666587592679647)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-reproducibilityArea: Reproducible / deterministic buildsArea: Reproducible / deterministic buildsC-bugCategory: This is a bug.Category: This is a bug.P-lowLow priorityLow 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.