-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce LocalDefId
to HirId
lookup table
#72552
Conversation
If thats ok @ecstatic-morse , i'd like to run a perf run. |
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 20f20ac7a07b7db98b26c50cf0926cc7a2f818db with merge ba85afd575ddccb47ea677511836c480c50c2b61... |
BTW, you committed an |
@marmeladema This is basically just #63849 right? @ljedrz did we come to a conclusion about the approach in #63849 (comment)? |
☀️ Try build successful - checks-azure |
Queued ba85afd575ddccb47ea677511836c480c50c2b61 with parent 46e85b4, future comparison URL. |
Finished benchmarking try commit ba85afd575ddccb47ea677511836c480c50c2b61, comparison URL. |
@ecstatic-morse I wasn't sure how to proceed there; there was a follow-up PR, #65837, but it was closed due to inactivity. |
20f20ac
to
7c501c6
Compare
Rebased and removed the mistakenly added About the approach here, I think the first commit is valuable no matter what because it just removes some useless uses of The 2 following commits are about removing all uses of And the last one is about replacing the now unused |
Ugh, that's a bummer. So @nikomatsakis (who reviewed #63849) and @eddyb (who authored #65837). AFAICT with my somewhat limited understanding of the current @eddyb opened #65837 to get this process started, but it was never seriously reviewed, so things have sort of stalled out. I guess I see two options:
|
@ecstatic-morse i think as a start, i can split out the cleanup commits in a separate PR in order to focus in the import bits. Should the cleanup include commit 1 or 1,2,3? Including the 3 commits would reduce the API surface involving |
I've split out the first commit into its own PR and i'll do the same for the next 2 commits if needed. |
Splitting out the commits seems good -- I think the appropriate next course of action would be a MCP. IIRC, the older attempts pre-dated the system, and a big part of the problem (for me) was that I never understood what was being proposed, not really. =) Or at least I remember feeling confused. A summary like the one that @ecstatic-morse just gave is very helpful-- I would be in favor of trying to adopt the "correct" scheme, but I think it'd be worth actually describing what that is apart from its implementation. |
Blocked on #72636. |
…, r=petrochenkov Cleanup `Resolver::<clone|into>_outputs` methods Follow-up cleanup work of rust-lang#72402 First commit has been split out from rust-lang#72552 r? @ecstatic-morse
This comment has been minimized.
This comment has been minimized.
7c501c6
to
afb616e
Compare
@@ -457,7 +443,7 @@ impl Definitions { | |||
// Create the definition. | |||
let def_id = LocalDefId { local_def_index: self.table.allocate(key, def_path_hash) }; | |||
|
|||
assert_eq!(self.def_id_to_node_id.push(node_id), def_id); | |||
assert_eq!(self.def_id_to_hir_id.push(None), def_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why we need these pushes with None
if we re-populate the whole def_id_to_hir_id
table below anyway.
The change looks entirely reasonably to me and it passes CI so it doesn't trip the Also, the first two commits could also be landed separately if the third one causes some questions. |
Looks like we are not too far from being able to eliminate
|
For ease of review, i'll split out the first two commits in a separate pull request. |
Blocked on #72750. |
…, r=petrochenkov Remove remaining calls to `as_local_node_id` Split out from rust-lang#72552 cc rust-lang#50928
☔ The latest upstream changes (presumably #72768) made this pull request unmergeable. Please resolve the merge conflicts. |
afb616e
to
12e85d7
Compare
Since the removal of all calls to `as_local_node_id`, the `def_id_to_node_id` table was useless. It is being replaced by a `def_id_to_hir_id` table which allows to lookup `HirId` from `LocalDefId` without indirection through `NodeId` tables.
12e85d7
to
67fcf63
Compare
Rebased on master |
@marmeladema The reason is that early lints have to work with |
The ultimate solution to this problem is probably creating Otherwise there's always some window in which you have no option except that to use |
I think keeping the map |
Yeah, it should be ok to move it from |
I've worked on another approach that might be better than this one actually. Let's close this for now. |
cc #50928
r? @ecstatic-morse