Skip to content

fix: ignore format literal source availability in stable hashes - #166377

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
paradoxicalguy:fix-svh-rust-src-153898-clean
Nov 27, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
paradoxicalguy:fix-svh-rust-src-153898-clean

Conversation

@paradoxicalguy

Copy link
Copy Markdown
Member

fixes #153898.

installing rust-src could change a crate's strict version hash (SVH) due to source-dependent format-string desugaring.
this change excludes the diagnostic-only FormatLiteral.source field from stable hashing while preserving diagnostic behavior.

adds a regression test covering unimplemented!, todo!, unreachable!, and generic functions.
verifies metadata with and without rust-src using identical compiler flags.

r? compiler

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 23, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-cloud-vms
rust-cloud-vms Bot force-pushed the fix-svh-rust-src-153898-clean branch from 9476d23 to 9710d00 Compare November 23, 2026 09:53
Comment thread compiler/rustc_span/src/hygiene.rs Resolved
Comment thread compiler/rustc_span/src/hygiene.rs Resolved
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 23, 2026
@rust-cloud-vms
rust-cloud-vms Bot force-pushed the fix-svh-rust-src-153898-clean branch from 9710d00 to bc2da2c Compare November 23, 2026 12:03
@rustbot

rustbot commented Nov 23, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in compiler/rustc_ast_lowering/src/format.rs

cc @m-ou-se

@paradoxicalguy

Copy link
Copy Markdown
Member Author

@rustbot ready!!

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 23, 2026
@fee1-dead

Copy link
Copy Markdown
Member

@rustbot reroll

@rustbot rustbot assigned panstromek and unassigned fee1-dead Nov 26, 2026
@panstromek

Copy link
Copy Markdown
Contributor

Stable hashing is tricky and I don't know this place very well.

I'm going to guess based on the area..

r? petrochenkov

@rustbot rustbot assigned petrochenkov and unassigned panstromek Nov 26, 2026
@petrochenkov

petrochenkov commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

I dislike the whole chain of PRs leading to this issue, source map (besides the currently compiled crate) shouldn't participate in anything that may end up in the compiled binaries.
This PR adds one more hack to the pile, fine @bors r+

@rust-bors

rust-bors Bot commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

📌 Commit bc2da2c has been approved by petrochenkov

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 27, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 27, 2026
…3898-clean, r=petrochenkov

fix: ignore format literal source availability in stable hashes

fixes [rust-lang#153898](rust-lang#153898).

installing rust-src could change a crate's strict version hash (SVH) due to source-dependent format-string desugaring.
this change excludes the diagnostic-only FormatLiteral.source field from stable hashing while preserving diagnostic behavior.

adds a regression test covering unimplemented!, todo!, unreachable!, and generic functions.
verifies metadata with and without rust-src using identical compiler flags.

r? compiler
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope)
 - #163910 (debugger: stabilize trim-paths unremap file loading)
 - #166175 (Use `__fastfail()` for `crash()` on Windows)
 - #166377 (fix: ignore format literal source availability in stable hashes)
 - #166510 (add c-variadic support for `x87_f80`)
 - #166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`)
 - #161531 (Remove `T: Send + Sync` bound from `Arc::downcast`)
 - #166641 (fix: bootstrap build directory handling with --set)
 - #166655 (Submodule update of rustc-perf)
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - #163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope)
 - #163910 (debugger: stabilize trim-paths unremap file loading)
 - #166377 (fix: ignore format literal source availability in stable hashes)
 - #166510 (add c-variadic support for `x87_f80`)
 - #166631 (Remove `fn terminator()` and `terminator_mut()`)
 - #166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`)
 - #161531 (Remove `T: Send + Sync` bound from `Arc::downcast`)
 - #166641 (fix: bootstrap build directory handling with --set)
 - #166655 (Submodule update of rustc-perf)
@rust-bors
rust-bors Bot merged commit 7ff6229 into rust-lang:main Nov 27, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 27, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 27, 2026
Rollup merge of #166377 - paradoxicalguy:fix-svh-rust-src-153898-clean, r=petrochenkov

fix: ignore format literal source availability in stable hashes

fixes [#153898](#153898).

installing rust-src could change a crate's strict version hash (SVH) due to source-dependent format-string desugaring.
this change excludes the diagnostic-only FormatLiteral.source field from stable hashing while preserving diagnostic behavior.

adds a regression test covering unimplemented!, todo!, unreachable!, and generic functions.
verifies metadata with and without rust-src using identical compiler flags.

r? compiler
mehmettoplu-rs pushed a commit to mehmettoplu-rs/miri that referenced this pull request Nov 28, 2026
…uwer

Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope)
 - rust-lang/rust#163910 (debugger: stabilize trim-paths unremap file loading)
 - rust-lang/rust#166377 (fix: ignore format literal source availability in stable hashes)
 - rust-lang/rust#166510 (add c-variadic support for `x87_f80`)
 - rust-lang/rust#166631 (Remove `fn terminator()` and `terminator_mut()`)
 - rust-lang/rust#166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`)
 - rust-lang/rust#161531 (Remove `T: Send + Sync` bound from `Arc::downcast`)
 - rust-lang/rust#166641 (fix: bootstrap build directory handling with --set)
 - rust-lang/rust#166655 (Submodule update of rustc-perf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strict version hash is sensitive to presence of standard library source code on host

7 participants