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

Remove queries from the driver interface #134302

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Dec 14, 2024

All uses of driver queries in the public api of rustc_driver have been removed in #134130 already. This removes driver queries from rustc_interface and does a couple of cleanups around TyCtxt construction and entering enabled by this removal.

Finishes the removal of driver queries started with #126834.

@bjorn3 bjorn3 added the A-driver Area: rustc_driver that ties everything together into the `rustc` compiler label Dec 14, 2024
@rustbot
Copy link
Collaborator

rustbot commented Dec 14, 2024

r? @BoxyUwU

rustbot has assigned @BoxyUwU.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 14, 2024
@rustbot
Copy link
Collaborator

rustbot commented Dec 14, 2024

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

&'tcx WorkerLocal<rustc_hir::Arena<'tcx>>,
F,
) -> T,
> = Box::new(move |compiler, gcx_cell, arena, hir_arena, f| {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is ugly, but the only way I could figure out to get all invariant lifetimes correctly inferred by rustc.


let res = f(tcx);
// FIXME maybe run finish even when a fatal error occured? or at least tcx.alloc_self_profile_query_strings()?
tcx.finish();
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixme is a pre-existing issue.

@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the remove_driver_queries branch from a5188c2 to 7738929 Compare December 14, 2024 14:24
@rust-log-analyzer

This comment has been minimized.

@bjorn3 bjorn3 force-pushed the remove_driver_queries branch from 19bf2af to b0cd37e Compare December 14, 2024 14:54
@jieyouxu
Copy link
Member

r? jieyouxu

@rustbot rustbot assigned jieyouxu and unassigned BoxyUwU Dec 15, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Thanks, this looks very reasonable to me as a first-pass review. This is tricky enough that I want a second pair of eyes on it.

@jieyouxu
Copy link
Member

r? @oli-obk (since you reviewed #134130)

@rustbot rustbot assigned oli-obk and unassigned jieyouxu Dec 15, 2024
@oli-obk
Copy link
Contributor

oli-obk commented Dec 15, 2024

Yea I already reviewed all of it but the lifetime stuff. But since at best I'd have some golfing for it, r=me,jieyouzu I can golf once it's landed

@jieyouxu
Copy link
Member

In that case, I say we try to land this first, the lifetimes in passes are a bit annoying but I don't think is worth blocking, as oli said.

@bors r=oli-obk,jieyouxu rollup=never (tricky driver changes)

@bors
Copy link
Contributor

bors commented Dec 15, 2024

📌 Commit b0cd37e has been approved by oli-obk,jieyouxu

It is now in the queue for this repository.

@bors bors 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 Dec 15, 2024
@jieyouxu
Copy link
Member

@bjorn3 if you feel like it, can you double-check the rustc_driver-related docs in rustc-dev-guide?

@bjorn3
Copy link
Member Author

bjorn3 commented Dec 15, 2024

I'm going to update the rustc dev guide.

Edit: rust-lang/rustc-dev-guide#2162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-driver Area: rustc_driver that ties everything together into the `rustc` compiler 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. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants