Skip to content

Adjust some doc for Query System #2465

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

Merged
merged 1 commit into from
Jun 14, 2025
Merged

Conversation

xizheyin
Copy link
Contributor

This PR improves the documentation for the rustc query system.

  • It is emphasized that the provider needs to be registered manually, not looked for by the compiler (this term is too vague).
  • Move local and extern provider explanation to the section Providers
  • Making the provider registration process easier to understand, with step-by-step explanations and clearer examples.

@rustbot
Copy link
Collaborator

rustbot commented Jun 13, 2025

Thanks for the PR. If you have write access, feel free to merge this PR if it does not need reviews. You can request a review using r? rustc-dev-guide or r? <username>.

@rustbot rustbot added the S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content label Jun 13, 2025
@rustbot

This comment has been minimized.

@xizheyin
Copy link
Contributor Author

r? rustc-dev-guide

[`wasm_import_module_map`][wasm_import_module_map], that `rustc_driver` can invoke.
1. Implement the provider function:
```rust,ignore
fn fubar<'tcx>(tcx: TyCtxt<'tcx>, key: DefId) -> Fubar<'tcx> { ... }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do this change in a future pr

Suggested change
fn fubar<'tcx>(tcx: TyCtxt<'tcx>, key: DefId) -> Fubar<'tcx> { ... }
fn fubar<'tcx>(tcx: TyCtxt<'tcx>, key: LocalDefId) -> Fubar<'tcx> { ... }

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, I see we now have ExternProvider as well (since rust-lang/rust#85830)... would you be able to adjust docs to account for it @xizheyin

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, I'm just working on this pr rust-lang/rust#142450, which involves extern providers.

@tshepang tshepang merged commit 91ede12 into rust-lang:master Jun 14, 2025
1 check passed
@xizheyin xizheyin deleted the rustc-query branch June 14, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants