librustc_hir: return LocalDefId instead of DefId in local_def_id#70909
librustc_hir: return LocalDefId instead of DefId in local_def_id#70909bors merged 2 commits intorust-lang:masterfrom
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.
These maps likely should be switched to LocalDefId.
|
@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_localand useLocalDefIdinstead ofDefIdwhere possible for #70853This adds some calls to
.to_def_id()to get aDefIdback when needed. I don't know if I should pushLocalDefIdeven further and change, for example,Res::Defto accept aLocalDefIdinstead of aDefIdas second argument.cc @ecstatic-morse