Skip to content

Make DocLinkResMap an FxIndexMap#159718

Open
jprochazk wants to merge 1 commit into
rust-lang:mainfrom
jprochazk:doc-link-res-index-map
Open

Make DocLinkResMap an FxIndexMap#159718
jprochazk wants to merge 1 commit into
rust-lang:mainfrom
jprochazk:doc-link-res-index-map

Conversation

@jprochazk

@jprochazk jprochazk commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Previously it was FxHashMap, changed to UnordMap in #119093. The rationale then was to make the iteration order unobservable, but it turned out to be leaky.

This change means the encoder outputs doc_link_resolutions entries in insertion order, and iteration order of the DocLinkResMap is now observable. I believe this doesn't affect correctness elsewhere, but I'm not very familiar with the codebase so I may be missing something

Discussed on zulip: #t-compiler/help > #159677: rmeta encoding is not stable

@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 Jul 22, 2026
@rustbot

rustbot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

r? @petrochenkov

rustbot has assigned @petrochenkov.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 74 candidates
  • Random selection from 20 candidates

@rustbot

This comment has been minimized.

@jprochazk
jprochazk force-pushed the doc-link-res-index-map branch from 6338fe7 to 66a783d Compare July 22, 2026 13:28
@rustbot

This comment has been minimized.

@jprochazk
jprochazk force-pushed the doc-link-res-index-map branch from 66a783d to b8365e9 Compare July 22, 2026 13:29
@rust-log-analyzer

This comment has been minimized.

Comment thread compiler/rustc_hir/src/def.rs Outdated
@petrochenkov

Copy link
Copy Markdown
Contributor

r=me after squashing commits.
@rustbot author

@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 Jul 22, 2026
@rustbot

rustbot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@jprochazk
jprochazk force-pushed the doc-link-res-index-map branch from 6fe4fa7 to 70b89c3 Compare July 22, 2026 15:33
@jprochazk

Copy link
Copy Markdown
Contributor Author

Squashed into one commit

@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 Jul 22, 2026
@mejrs

mejrs commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Thanks!

@bors r=petrochenkov

@rust-bors

rust-bors Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 70b89c3 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 Jul 22, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 22, 2026
…r=petrochenkov

Make `DocLinkResMap` an `FxIndexMap`

Previously it was `FxHashMap`, changed to `UnordMap` in rust-lang#119093. The rationale then was to make the iteration order unobservable, but it turned out to be leaky.

This change means the encoder outputs `doc_link_resolutions` entries in insertion order, and iteration order of the `DocLinkResMap` is now observable. I believe this doesn't affect correctness elsewhere, but I'm not very familiar with the codebase so I may be missing something

* Closes rust-lang#159677

Discussed on zulip: [#t-compiler/help > rust-lang#159677: rmeta encoding is not stable](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.23159677.3A.20rmeta.20encoding.20is.20not.20stable/with/612134270)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Jul 22, 2026
…r=petrochenkov

Make `DocLinkResMap` an `FxIndexMap`

Previously it was `FxHashMap`, changed to `UnordMap` in rust-lang#119093. The rationale then was to make the iteration order unobservable, but it turned out to be leaky.

This change means the encoder outputs `doc_link_resolutions` entries in insertion order, and iteration order of the `DocLinkResMap` is now observable. I believe this doesn't affect correctness elsewhere, but I'm not very familiar with the codebase so I may be missing something

* Closes rust-lang#159677

Discussed on zulip: [#t-compiler/help > rust-lang#159677: rmeta encoding is not stable](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.23159677.3A.20rmeta.20encoding.20is.20not.20stable/with/612134270)
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Jul 22, 2026
…r=petrochenkov

Make `DocLinkResMap` an `FxIndexMap`

Previously it was `FxHashMap`, changed to `UnordMap` in rust-lang#119093. The rationale then was to make the iteration order unobservable, but it turned out to be leaky.

This change means the encoder outputs `doc_link_resolutions` entries in insertion order, and iteration order of the `DocLinkResMap` is now observable. I believe this doesn't affect correctness elsewhere, but I'm not very familiar with the codebase so I may be missing something

* Closes rust-lang#159677

Discussed on zulip: [#t-compiler/help > rust-lang#159677: rmeta encoding is not stable](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.23159677.3A.20rmeta.20encoding.20is.20not.20stable/with/612134270)
@GuillaumeGomez

Copy link
Copy Markdown
Member

Failed in try build in #159742.

@bors r-

@rust-bors rust-bors Bot 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 22, 2026
@rust-bors

rust-bors Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in the following rollups:

View changes since this unapproval

@@ -0,0 +1,28 @@
// Regression test for <https://github.com/rust-lang/rust/issues/159677>.

@jprochazk jprochazk Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this test failed because it tried to build with std, but that target doesn't support std.

The target doesn't matter much for this test, so I'll add needs-target-std

View changes since the review

also add regression test for rmeta reproducibility when unrelated `rlib`
are in the search path

Co-authored-by: mejrs <59372212+mejrs@users.noreply.github.com>
@jprochazk
jprochazk force-pushed the doc-link-res-index-map branch from 70b89c3 to f9d9939 Compare July 22, 2026 23:44
@rustbot

rustbot commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@jprochazk

Copy link
Copy Markdown
Contributor Author

Added //@ needs-target-std, and rebased the branch. This might warrant a try run, but I'm not sure I can trigger that myself?

@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 Jul 22, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member

It's fine, thanks for the update!

@bors r=petrochenkov

@rust-bors

rust-bors Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

📌 Commit f9d9939 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 Jul 23, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 23, 2026
…r=petrochenkov

Make `DocLinkResMap` an `FxIndexMap`

Previously it was `FxHashMap`, changed to `UnordMap` in rust-lang#119093. The rationale then was to make the iteration order unobservable, but it turned out to be leaky.

This change means the encoder outputs `doc_link_resolutions` entries in insertion order, and iteration order of the `DocLinkResMap` is now observable. I believe this doesn't affect correctness elsewhere, but I'm not very familiar with the codebase so I may be missing something

* Closes rust-lang#159677

Discussed on zulip: [#t-compiler/help > rust-lang#159677: rmeta encoding is not stable](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.23159677.3A.20rmeta.20encoding.20is.20not.20stable/with/612134270)
rust-bors Bot pushed a commit that referenced this pull request Jul 23, 2026
Rollup of 18 pull requests

Successful merges:

 - #138618 (Support using const pointers in asm `const` operand)
 - #150161 (Remove 'static requirement on try_as_dyn)
 - #158362 (trait solver: account for universes from replace_bound_vars)
 - #159173 (Add allowed list check on EII implementations attributes)
 - #159466 (cmse: clear variant-dependent padding in `enum`s)
 - #159718 (Make `DocLinkResMap` an `FxIndexMap`)
 - #155795 (constify `vec![1, 2, 3]` macro)
 - #157776 (ci: Enable autodiff tests on x86_64 linux)
 - #157905 (Update comments and add tests for `-Zrandomize-layout` for some guaranteed ZSTs)
 - #159041 (Reorganize `tests/ui/issues` [22/N])
 - #159108 (Reorganize `tests/ui/issues` [23/N])
 - #159138 (doc: document wasm import symbol mangling)
 - #159531 (Reorganize `tests/ui/issues` [28/N])
 - #159608 (early_otherwise: Don't hoist dereferences when the otherwise branch is reachable)
 - #159612 (Reorganize `tests/ui/issues` [29/N])
 - #159653 (run `tests/assembly-llvm/asm/aarch64-types.rs` for `aarch64_be`)
 - #159759 (rustc-dev-guide subtree update)
 - #159761 (Remove outdated comment for resolve_vars_with_obligations)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 23, 2026
…r=petrochenkov

Make `DocLinkResMap` an `FxIndexMap`

Previously it was `FxHashMap`, changed to `UnordMap` in rust-lang#119093. The rationale then was to make the iteration order unobservable, but it turned out to be leaky.

This change means the encoder outputs `doc_link_resolutions` entries in insertion order, and iteration order of the `DocLinkResMap` is now observable. I believe this doesn't affect correctness elsewhere, but I'm not very familiar with the codebase so I may be missing something

* Closes rust-lang#159677

Discussed on zulip: [#t-compiler/help > rust-lang#159677: rmeta encoding is not stable](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.23159677.3A.20rmeta.20encoding.20is.20not.20stable/with/612134270)
jhpratt added a commit to jhpratt/rust that referenced this pull request Jul 23, 2026
…r=petrochenkov

Make `DocLinkResMap` an `FxIndexMap`

Previously it was `FxHashMap`, changed to `UnordMap` in rust-lang#119093. The rationale then was to make the iteration order unobservable, but it turned out to be leaky.

This change means the encoder outputs `doc_link_resolutions` entries in insertion order, and iteration order of the `DocLinkResMap` is now observable. I believe this doesn't affect correctness elsewhere, but I'm not very familiar with the codebase so I may be missing something

* Closes rust-lang#159677

Discussed on zulip: [#t-compiler/help > rust-lang#159677: rmeta encoding is not stable](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.23159677.3A.20rmeta.20encoding.20is.20not.20stable/with/612134270)
rust-bors Bot pushed a commit that referenced this pull request Jul 23, 2026
Rollup of 19 pull requests

Successful merges:

 - #150161 (Remove 'static requirement on try_as_dyn)
 - #158362 (trait solver: account for universes from replace_bound_vars)
 - #159173 (Add allowed list check on EII implementations attributes)
 - #159466 (cmse: clear variant-dependent padding in `enum`s)
 - #159718 (Make `DocLinkResMap` an `FxIndexMap`)
 - #155795 (constify `vec![1, 2, 3]` macro)
 - #157776 (ci: Enable autodiff tests on x86_64 linux)
 - #157905 (Update comments and add tests for `-Zrandomize-layout` for some guaranteed ZSTs)
 - #158766 (Promote riscv64-unknown-linux-musl to tier 2 with host tools)
 - #159041 (Reorganize `tests/ui/issues` [22/N])
 - #159108 (Reorganize `tests/ui/issues` [23/N])
 - #159138 (doc: document wasm import symbol mangling)
 - #159531 (Reorganize `tests/ui/issues` [28/N])
 - #159608 (early_otherwise: Don't hoist dereferences when the otherwise branch is reachable)
 - #159612 (Reorganize `tests/ui/issues` [29/N])
 - #159653 (run `tests/assembly-llvm/asm/aarch64-types.rs` for `aarch64_be`)
 - #159667 (Make some parser structured suggestions verbose and tweak their wording)
 - #159759 (rustc-dev-guide subtree update)
 - #159761 (Remove outdated comment for resolve_vars_with_obligations)
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.

.rmeta contents depend on unrelated files in the library search path

6 participants