Skip to content

Conversation

celinval
Copy link
Contributor

We no longer need two thread-local variables to store the context. We used to have two because the conversion logic used to live in a separate crate from the rest of the business logic.

I'm also merging the Container struct and the CompilerInterface trait as a single struct. This removes the unnecessary indirection and code duplication. Using a trait would also block us from adding any generic method to the compiler interface.

r? @oli-obk

cc: @makai410

@rustbot
Copy link
Collaborator

rustbot commented Oct 20, 2025

This PR changes rustc_public

cc @oli-obk, @celinval, @ouz-a

@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. labels Oct 20, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 20, 2025

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

Copy link
Contributor

@makai410 makai410 left a comment

Choose a reason for hiding this comment

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

The overall solution LGTM.

View changes since this review

Comment on lines 69 to 74
/// Public API for querying compiler information.
///
/// All queries are delegated to [`rustc_public_bridge::context::CompilerCtxt`] that provides
/// similar APIs but based on internal rustc constructs.
///
/// Do not use this directly. This is currently used in the macro expansion.
Copy link
Contributor

Choose a reason for hiding this comment

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

Why was this doc removed?

Copy link
Contributor Author

@celinval celinval Oct 21, 2025

Choose a reason for hiding this comment

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

My mistake. Let me get it back.

@bors
Copy link
Collaborator

bors commented Oct 21, 2025

☔ The latest upstream changes (presumably #147928) made this pull request unmergeable. Please resolve the merge conflicts.

We no longer need two thread-local variables to store the context.
We used to have two because the conversion logic used to live in a
separate crate from the rest of the business logic.

I'm also removing the Container struct and replacing the
CompilerInterface trait with a struct. This removes the unnecessary
indirection and code duplication. Using a trait would also block us
from adding any generic method to the compiler interface.
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. 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