Uh oh!
There was an error while loading. Please reload this page.
Decouple rustc_resolve and rustc_ast_lowering - #90451
Conversation
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Do they necessarily have resolutions in multiple namespaces?
| /// Resolutions for import nodes, which have multiple resolutions in different namespaces. | |
| /// Resolutions for import nodes, which can have multiple resolutions in different namespaces. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
michaelwoerister
commented
Nov 2, 2021
I think @petrochenkov might be more qualified to review this. |
michaelwoerister
commented
Nov 2, 2021
r? @petrochenkov (let me know if you don't want to review) |
Uh oh!
There was an error while loading. Please reload this page.
This comment has been minimized.
This comment has been minimized.
petrochenkov
commented
Nov 4, 2021
fca3de8 to
60431ecCompare
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.
56f46ed to
63e9a5aComparerust-timer
commented
Dec 18, 2021
Queued 11af4eda005db3083b170328e09db3f9625d6adf with parent d3f3004, future comparison URL. |
rust-timer
commented
Dec 18, 2021
Finished benchmarking commit (11af4eda005db3083b170328e09db3f9625d6adf): comparison url. Summary: This change led to small relevant mixed results 🤷 in compiler performance.
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR led to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never |
petrochenkov
commented
Dec 20, 2021
r=me on 5c4f828, f19a7f1 and baef1d2. I need more context for other changes, why are they useful? |
63e9a5a to
87fae88Comparecjgillot
commented
Dec 27, 2021
The context is #88186: the objective is to make lowering a query. For this to happen, we need:
I agree these two commits do not bring any obvious value right now. I can delay them to another PR if you prefer. |
| /// `rustc_middle` is independent of the parser, we use dynamic dispatch here. | ||
| nt_to_tokenstream: NtToTokenstream, | ||
| item_generics_num_lifetimes: fn(&Session, &CrateStoreDyn, DefId) -> usize, |
There was a problem hiding this comment.
Maybe it's better to make this a method on the CrateStore trait?
| fn legacy_const_generic_args(&mut self, expr: &Expr) -> Option<Vec<usize>>; | ||
| /// Obtains resolution for a `NodeId` with a single resolution. | ||
| trait ResolverAstLoweringExt { |
There was a problem hiding this comment.
Why does this need to be a trait rather than a set of inherent methods?
petrochenkov
commented
Dec 29, 2021
@cjgillot The main question is how mutable are I expected It also doesn't feel right that a bunch of tables in Perhaps we need more separate structures created using the next criteria? |
cjgillot
commented
Dec 30, 2021
The basic idea is to make lowering incremental, so we will have to keep some resolver outputs longer than we currently have to. The issue you have with mutable vs immutable outputs probably comes from a poor choice of mine when splitting up #88186. If you don't mind, I will close this PR and try to make the splitting more logical.
|
Make lowering pull-based ~Based on rust-lang#90451 Part of rust-lang#88186 The current lowering code visits all the item-likes in the AST in order, and lowers them one by one. This PR changes it to index the AST and then proceed to lowering on-demand. This is closer to the logic of query-based lowering.
Based on #89090 and #90446.Part of #88186.
This PR removes the
ResolverAstLoweringtrait which existed to pass information from resolution to lowering. The required information is passed through theResolverOutputsstruct.r? @michaelwoerister