Skip to content

Comments

Remove rustc_feedable_queries and define_feedable macros.#153009

Merged
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
nnethercote:rm-define_feedable
Feb 24, 2026
Merged

Remove rustc_feedable_queries and define_feedable macros.#153009
rust-bors[bot] merged 1 commit intorust-lang:mainfrom
nnethercote:rm-define_feedable

Conversation

@nnethercote
Copy link
Contributor

The can be folded into rustc_with_all_queries and define_callbacks. Details in individual commits.

r? @oli-obk

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 23, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 23, 2026

oli-obk is not on the review rotation at the moment.
They may take a while to respond.

@nnethercote
Copy link
Contributor Author

cc @Zalathar @cjgillot @Zoxc

@Zalathar
Copy link
Member

The first commit (not tracking modifier idents) breaks rust-analyzer integration for hovering/clicking on modifier names.

The second commit (removing rustc_feedable_queries!) was on my TODO list, so I'm happy to see it done.

@rust-log-analyzer

This comment has been minimized.

@nnethercote
Copy link
Contributor Author

The second commit (removing rustc_feedable_queries!) was on my TODO list, so I'm happy to see it done.

I have some follow-ups that remove the _description_fns and _cache_on_disk_if_fns modules, and I think removing _analyzer_hints should also be possible. In each case this is achieved by moving stuff out of the proc macro into the declarative macro, by tweaking the modifiers list. The overall aim is simplifying the proc macro so instead of generating two declarative macros and three modules, it produces just a single declarative macro.

`rustc_queries!` produces two macros: `rustc_with_all_queries` and
`rustc_feedable_queries`. The latter is similar to the former but only
includes feedable queries.

But feedable queries don't need a separate mechanism because we can
identify feedable queries within `define_callbacks!` by just looking for
the `feedable` modifier. (That's what we do with every modifier other
than `feedable`.)

This commit removes the special handling and treats feedable queries
like everything else.

Note that this commit exposes and fixes a latent doc bug. The doc
comment for query `explicit_predicates_of` links to
`Self::predicates_of`. `explicit_predicates_of` is a feedable query but
`predicates_of` is not, so for `TyCtxtFeed` this link is invalid. This
wasn't manifesting because `TyCtxtFeed` wasn't getting doc comments
attached. It now is, so I changed the link to `TyCtxt::predicates_of`.
@rustbot
Copy link
Collaborator

rustbot commented Feb 23, 2026

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@nnethercote
Copy link
Contributor Author

I have removed the first commit. And I fixed the doc failure, which turned out to be caused by a latent bug; details in the commit message.

@oli-obk
Copy link
Contributor

oli-obk commented Feb 24, 2026

Thanks, this is much better than my impl

@bors r+

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 24, 2026

📌 Commit 8ac769f has been approved by oli-obk

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 24, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 24, 2026
…oli-obk

Remove `rustc_feedable_queries` and `define_feedable` macros.

The can be folded into `rustc_with_all_queries` and `define_callbacks`. Details in individual commits.

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 24, 2026
…oli-obk

Remove `rustc_feedable_queries` and `define_feedable` macros.

The can be folded into `rustc_with_all_queries` and `define_callbacks`. Details in individual commits.

r? @oli-obk
rust-bors bot pushed a commit that referenced this pull request Feb 24, 2026
…uwer

Rollup of 15 pull requests

Successful merges:

 - #152176 (Neon fast path for str::contains)
 - #152657 (std: move `exit` out of PAL)
 - #152841 (Streamline `QueryVTableUnerased` into `GetQueryVTable`)
 - #152845 (Skip `tidy` in PR CI jobs not dedicated to running `tidy`)
 - #152897 (Add optional json logging)
 - #153009 (Remove `rustc_feedable_queries` and `define_feedable` macros.)
 - #151558 (Port diagnostic attributes)
 - #152492 (mGCA: Enforce WF element types for array valtrees)
 - #152888 (Fix async drop glue MIR bug)
 - #152988 (Port `#[register_tool]` to the new attribute system)
 - #153018 (`unused_must_use` lint improvements)
 - #153023 (Update books)
 - #153033 (Clarify how "ensure" queries check whether they can skip execution)
 - #153043 (fix error on missing value for -C flags)
 - #153045 (rustc-dev-guide subtree update)

Failed merges:

 - #153032 (Fix attribute parser and kind names.)
@rust-bors rust-bors bot merged commit 0c18ab7 into rust-lang:main Feb 24, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 24, 2026
rust-timer added a commit that referenced this pull request Feb 24, 2026
Rollup merge of #153009 - nnethercote:rm-define_feedable, r=oli-obk

Remove `rustc_feedable_queries` and `define_feedable` macros.

The can be folded into `rustc_with_all_queries` and `define_callbacks`. Details in individual commits.

r? @oli-obk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants