Remove all uses of NodeId in ResolverOutputs#72402
Conversation
ecstatic-morse
left a comment
There was a problem hiding this comment.
cc @ljedrz
Left a nit. I'll approve once it is fixed and CI is green. Thanks @marmeladema!
src/librustc_middle/ty/mod.rs
Outdated
There was a problem hiding this comment.
It does seem like all of these could plausibly be DefId. Did you find something during your experiments that wasn't a definition? If not, we should open a cleanup issue once this gets merged.
There was a problem hiding this comment.
I've only tried for trait_map but yes, for this field, there is no def id, only hir id
There was a problem hiding this comment.
@petrochenkov I see you've assigned yourself. Any recommendations here? Is there a reason that trait_map and export_map cannot use DefIds?
There was a problem hiding this comment.
Also because the global context uses HirId, using DefId here would mean another map clone/conversion in librustc_middle.
There was a problem hiding this comment.
The zoo of DefIds, LocalDefIds and HirIds here is a bit surprising (all of these could be LocalDefIds (or HirIds)), but it looks like the choices are made to minimize conversions at use sites.
I guess the right thing to do here would be changing DefIds into LocalDefIds in GlobalCtxt which is the end destination of these tables.
There was a problem hiding this comment.
I can definitely take a look at that in a follow up PR!
…tead of `NodeId`
bc1f1f1 to
f31e076
Compare
|
Rebased and fixed comments |
|
Thanks @marmeladema! It's possible that someone with more knowledge of AST -> HIR lowering (@petrochenkov?) could find an elegant solution to #72402 (comment). However, because this may unlock #50928 (comment), I'm happy to approve it in its present state. @bors r+ |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
📌 Commit f31e076 has been approved by |
…, r=ecstatic-morse Remove all uses of `NodeId` in `ResolverOutputs` cc rust-lang#50928 r? @ecstatic-morse
…, r=ecstatic-morse Remove all uses of `NodeId` in `ResolverOutputs` cc rust-lang#50928 r? @ecstatic-morse
…, r=ecstatic-morse Remove all uses of `NodeId` in `ResolverOutputs` cc rust-lang#50928 r? @ecstatic-morse
Rollup of 5 pull requests Successful merges: - rust-lang#72402 (Remove all uses of `NodeId` in `ResolverOutputs`) - rust-lang#72527 (bootstrap: propagate test-args to miri and clippy test suites) - rust-lang#72530 (Clean up E0602 explanation) - rust-lang#72532 (Use `dyn` trait syntax in more comments and docs) - rust-lang#72535 (Use sort_unstable_by in its own docs) Failed merges: r? @ghost
…, 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
cc #50928
r? @ecstatic-morse