internal: Do not relower the signature again in inference, instead fetch it from other queries - #23190
Open
ChayimFriedman2 wants to merge 2 commits into
Open
internal: Do not relower the signature again in inference, instead fetch it from other queries#23190ChayimFriedman2 wants to merge 2 commits into
ChayimFriedman2 wants to merge 2 commits into
Conversation
The new code is more consistent, easier to maintain and not forget to cover all cases when we add new things (e.g. new queries creating anon consts), and fixes a few missing edges (see the changed diagnostics in incorrect_case that now emit a diagnostic they haven't previously).
…m other queries Not only this helps perf, this also make it possible to define `AnonConst` as a tracked struct (but this PR doesn't do that yet), because it won't be created twice. There's a slight regression in tests because I followed rustc and liberated late bounds regions in the signature, and the printing of bound regions is suboptimal. I didn't fix this to not interfere with @dfireBird's work.
Member
TBH, we should liberate the late bound regions when doing inference. We could potentially remove this field as well: https://github.com/ChayimFriedman2/rust-analyzer/blob/08383ae310109cda25123fe77fd4521772b746b9/crates/hir-ty/src/lower.rs#L232 |
Contributor
Author
|
We still use |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not only this helps perf, this also make it possible to define
AnonConstas a tracked struct (but this PR doesn't do that yet), because it won't be created twice.There's a slight regression in tests because I followed rustc and liberated late bounds regions in the signature, and the printing of bound regions is suboptimal. I didn't fix this to not interfere with @dfireBird's work.
For that to work I had to first push the first commit that refactors collection of diagnostics in
hir. The commit are almost fully separate and can be reviewed separately.