-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
librustc_hir: return LocalDefId instead of DefId in local_def_id #70909
librustc_hir: return LocalDefId instead of DefId in local_def_id #70909
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @varkor (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
maybe_unused_trait_imports: resolutions | ||
.maybe_unused_trait_imports | ||
.into_iter() | ||
.map(|id| definitions.local_def_id(id)) | ||
.map(|id| definitions.local_def_id(id).to_def_id()) | ||
.collect(), | ||
maybe_unused_extern_crates: resolutions | ||
.maybe_unused_extern_crates | ||
.into_iter() | ||
.map(|(id, sp)| (definitions.local_def_id(id), sp)) | ||
.map(|(id, sp)| (definitions.local_def_id(id).to_def_id(), sp)) | ||
.collect(), | ||
glob_map: resolutions | ||
.glob_map | ||
.into_iter() | ||
.map(|(id, names)| (definitions.local_def_id(id), names)) | ||
.map(|(id, names)| (definitions.local_def_id(id).to_def_id(), names)) | ||
.collect(), |
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.
These maps likely should be switched to LocalDefId
.
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.
r=me modulo nit
@bors r+ rollup=never (unclear what perf impact this may have) |
📌 Commit 6ae3888 has been approved by |
🌲 The tree is currently closed for pull requests below priority 1000, this pull request will be tested once the tree is reopened |
@bors p=1 |
☀️ Test successful - checks-azure |
Performance impact looks neglibigle (I'm curious what will happen we start moving queries over). |
Its a first try to remove a few calls to
expect_local
and useLocalDefId
instead ofDefId
where possible for #70853This adds some calls to
.to_def_id()
to get aDefId
back when needed. I don't know if I should pushLocalDefId
even further and change, for example,Res::Def
to accept aLocalDefId
instead of aDefId
as second argument.cc @ecstatic-morse