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.

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 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)
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

5 participants