-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Lower only one HIR owner at a time #87234
Conversation
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
cc @petrochenkov since this moves some things to rustc_resolve |
This comment has been minimized.
This comment has been minimized.
Blocked on #84373. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@cjgillot |
This comment has been minimized.
This comment has been minimized.
3514603
to
5f067ce
Compare
By "HirId preallocation", for lack of a better word, I mean calls to
I had changed that before messing up the rebase. |
95c7e88
to
11024b2
Compare
@@ -106,12 +94,12 @@ impl<'hir> LoweringContext<'_, 'hir> { | |||
// only used when lowering a child item of a trait or impl. | |||
fn with_parent_item_lifetime_defs<T>( | |||
&mut self, | |||
parent_hir_id: hir::ItemId, | |||
parent_hir_id: 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.
parent_hir_id: LocalDefId, | |
parent_def_id: LocalDefId, |
@@ -550,7 +546,7 @@ impl<'hir> LoweringContext<'_, 'hir> { | |||
|
|||
// Add all the nested `PathListItem`s to the HIR. | |||
for &(ref use_tree, id) in trees { | |||
let new_hir_id = self.allocate_hir_id_counter(id); | |||
let new_hir_id = self.resolver.local_def_id(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.
let new_hir_id = self.resolver.local_def_id(id); | |
let new_def_id = self.resolver.local_def_id(id); |
@bors r+ |
📌 Commit 11024b2 has been approved by |
⌛ Testing commit 11024b2 with merge 7da30f2d33a61ad8b1742097dd71ffc698d1dc8c... |
💥 Test timed out |
@bors retry |
☀️ Test successful - checks-actions |
I think this commit was one that was left out of the normal perf service. Here is what the weekly perf triage report says about it: Lower only one HIR owner at a time #87234
Looking at the results by eye, I'd say its clearly a big win. @rustbot label: perf-regression-triaged |
Based on #83723
Additional diff is here: cjgillot/rust@ownernode...lower-mono
Lowering is very tangled and has a tendency to intertwine the transformation of different items. This PR aims at simplifying the logic by:
I also removed the sorting of bodies by span. The diagnostic ordering changes marginally, since definitions are pretty much sorted already according to the AST. This uncovered a subtlety in thir-unsafeck.
(While these items could logically be in different PRs, the dependency between commits and the amount of conflicts force a monolithic PR.)