Skip to content
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

internal: Use ItemTree for variant, field and module attribute collection in attrs_query #12840

Merged
merged 4 commits into from
Jul 22, 2022

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Jul 21, 2022

Less parsing = very good, should speed up lang item collection as that basically probes attributes of all enum variants which currently triggers parsing

Not fond of how this is searching for the correct index, ideally we'd map between HIR and item tree Id here but I am not sure how, storing the item tree ids in the HIR version doesn't work due to the usage of Trace...

@Veykril Veykril changed the title internal: Use itemtree for variant and field attribute collection internal: Use ItemTree for variant and field attribute collection Jul 21, 2022
@Veykril
Copy link
Member Author

Veykril commented Jul 21, 2022

So usually we fetch the item tree index via Lookup::lookup fetching the *Loc data, we don't have that for variants or fields, so the question is, would it make sense adding these? It sounds like that would increase memory usage by a good bit potentially so I'm not sure. Similarly it would be beneficial for us to be able to fetch the item tree id of a module, that way we can basically skip parsing for modules in attr_query altogether (except for Blockexpr modules but those are rare anyways)

@Veykril Veykril marked this pull request as ready for review July 21, 2022 14:12
@Veykril Veykril changed the title internal: Use ItemTree for variant and field attribute collection internal: Use ItemTree for variant, field and module attribute collection Jul 21, 2022
@Veykril Veykril changed the title internal: Use ItemTree for variant, field and module attribute collection internal: Use ItemTree for variant, field and module attribute collection in attrs_query Jul 21, 2022
@Veykril
Copy link
Member Author

Veykril commented Jul 22, 2022

@bors r+

@bors
Copy link
Contributor

bors commented Jul 22, 2022

📌 Commit 0081ef3 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jul 22, 2022

⌛ Testing commit 0081ef3 with merge d469e0d...

@bors
Copy link
Contributor

bors commented Jul 22, 2022

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing d469e0d to master...

@bors bors merged commit d469e0d into rust-lang:master Jul 22, 2022
@Veykril Veykril deleted the be-lazy branch July 23, 2022 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants