Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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.

Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
@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.

Copy link
Member

Choose a reason for hiding this comment

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

alright... feel free to modify rdg there as well, to avoid having to open a separate pr here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought the changes to rdg could only be made here. It seems that I can submit other improvements in rust-lang/rust in the future.

But for this improvement, I think it would be better to submit it here, because rust-lang/rust may take time to synchronize.

Copy link
Member

@tshepang tshepang Jun 17, 2025

Choose a reason for hiding this comment

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

  • larger PRs generally take longer to be reviewed here, so I would not worry about the lag
  • doing docs changes on the other side has more chances of being reviewed by someone more familiar with what is being documented on the other side (since they would be the one reviewing the non-doc part)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see. In the future, I will submit pr related to a specific code part in rust-lang/rust. Thanks.

@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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.