Skip to content

Don't share id_map and deref_id_map#82424

Closed
camelid wants to merge 7 commits intorust-lang:masterfrom
camelid:dont-share-id_map
Closed

Don't share id_map and deref_id_map#82424
camelid wants to merge 7 commits intorust-lang:masterfrom
camelid:dont-share-id_map

Conversation

@camelid
Copy link
Member

@camelid camelid commented Feb 23, 2021

All the tests passed, so it doesn't seem they need to be shared.
Plus they should be item/page-specific.

I'm not sure why they were shared before. I think the reason id_map
worked as a shared value before is that it is cleared before rendering
each item (in render_item). And then I'm guessing deref_id_map
worked because it's a hashmap keyed by DefId, so there was no overlap
(though I'm guessing we could have had issues in the future).

Note that id_map currently still has to be cleared because otherwise
child items would inherit the id_map of their parent. I'm hoping to
figure out a way to stop cloning Context, but until then we have to
reset id_map.

Builds on top of #82356 (otherwise we'd have merge conflicts), so this is
blocked on that PR.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-cleanup Category: PRs that clean code up or issues documenting cleanup. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants