Skip to content

Split SpannedTypeVisitor into its own crate, rustc_ty_walk - #160362

Open
joshtriplett wants to merge 2 commits into
rust-lang:mainfrom
joshtriplett:ty-walk-crate
Open

Split SpannedTypeVisitor into its own crate, rustc_ty_walk#160362
joshtriplett wants to merge 2 commits into
rust-lang:mainfrom
joshtriplett:ty-walk-crate

Conversation

@joshtriplett

Copy link
Copy Markdown
Member

rustc_privacy pulls in all of rustc_ty_utils, but only wants SpannedTypeVisitor and walk_types. Move those to a small rustc_ty_walk crate.

This allows rustc_privacy to start building much sooner.

`rustc_privacy` pulls in all of `rustc_ty_utils`, but only wants
`SpannedTypeVisitor` and `walk_types`. Move those to a small
`rustc_ty_walk` crate.

This allows `rustc_privacy` to start building much sooner.
@rustbot

rustbot commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

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.

@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 Aug 1, 2026
@rustbot

rustbot commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

r? @fee1-dead

rustbot has assigned @fee1-dead.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 18 candidates

@rust-log-analyzer

This comment has been minimized.

@mejrs

mejrs commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

You need to bless bootstrap, see https://github.com/rust-lang/rust/blob/main/src/bootstrap/README.md#testing

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Aug 2, 2026

@fee1-dead fee1-dead Aug 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is there a way to just move these to be defined to rustc_privacy directly?

View changes since the review

@joshtriplett joshtriplett Aug 2, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@fee1-dead They're used by both rustc_ty_utils and rustc_privacy, so they need to be in a common crate available to both. I don't want to make rustc_ty_utils depend on rustc_privacy, and I don't think they logically fit in rustc_privacy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Logically it probably fits in rustc_middle - not that I want to move stuff there.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 2, 2026
@joshtriplett

Copy link
Copy Markdown
Member Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 2, 2026
@mejrs

mejrs commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

I think we should consider splitting up rustc_ty_utils (perhaps poorly named if it's just providing queries now?) further:

crate A: Queries that need rustc_trait_selection
crate B: Queries that only need rustc_middle (or perhaps rustc_infer - haven't thought about what the best split is here)
crate C: What this pr calls rustc_ty_walk - the actual util stuff shared between A and B and other crates. Maybe there's also stuff currently defined in rustc_middle that could be moved here.

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-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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