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

Add more methods for resolving definitions from AST to their corresponding HIR types #16703

Merged
merged 2 commits into from
Mar 4, 2024

Conversation

regexident
Copy link
Contributor

In order to be able to add these methods with consistent naming I had to also rename two existing methods that would otherwise be conflicting/confusing:

Semantics::to_module_def(&self, file: FileId) -> Option<Module> (before)
Semantics::file_to_module_def(&self, file: FileId) -> Option<Module> (after)

Semantics::to_module_defs(&self, file: FileId) -> impl Iterator<Item = Module> (before)
Semantics::file_to_module_defs(&self, file: FileId) -> impl Iterator<Item = Module> (after)

(the PR is motivated by an outside use of the ra_ap_hir crate that would benefit from being able to walk a hir::Function's AST, resolving its exprs/stmts/items to their HIR equivalents)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 28, 2024
@Veykril
Copy link
Member

Veykril commented Feb 28, 2024

@bors r+

@regexident regexident changed the title Add a more methods for resolving definitions from AST to their corresponding HIR types Add more methods for resolving definitions from AST to their corresponding HIR types Feb 28, 2024
@Veykril
Copy link
Member

Veykril commented Feb 29, 2024

@bors r+

2 similar comments
@Veykril
Copy link
Member

Veykril commented Mar 1, 2024

@bors r+

@Veykril
Copy link
Member

Veykril commented Mar 4, 2024

@bors r+

@regexident
Copy link
Contributor Author

Bots having a moment? 😅

@Veykril
Copy link
Member

Veykril commented Mar 4, 2024

bors is always having a moment

@Veykril Veykril closed this Mar 4, 2024
@Veykril Veykril reopened this Mar 4, 2024
@Veykril
Copy link
Member

Veykril commented Mar 4, 2024

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 4, 2024

📌 Commit fac8a14 has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Mar 4, 2024

⌛ Testing commit fac8a14 with merge d8feb90...

@bors
Copy link
Collaborator

bors commented Mar 4, 2024

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

@bors bors merged commit d8feb90 into rust-lang:master Mar 4, 2024
21 checks passed
@regexident regexident deleted the sema-ast-to-hir branch March 4, 2024 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants