Skip to content

Extract all instance shim variants into new ShimKind enum#158105

Open
camelid wants to merge 3 commits into
rust-lang:mainfrom
camelid:group-shims
Open

Extract all instance shim variants into new ShimKind enum#158105
camelid wants to merge 3 commits into
rust-lang:mainfrom
camelid:group-shims

Conversation

@camelid

@camelid camelid commented Jun 18, 2026

Copy link
Copy Markdown
Member

They tend to have similar handling -- e.g., they should be the only
input to the mir_shims query -- so it's cleaner to group them
together. This will also make potential future refactorings easier, such
as only carrying GenericArgsRef for instances that actually use it
(e.g., Item) but not others (e.g., CloneShim).

cc https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/moving.20ty.3A.3AInstance.2Eargs.20into.20ty.3A.3AInstanceKind.20variants
r? @oli-obk

@rustbot

rustbot commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

rustc_codegen_cranelift is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_cranelift instead.

cc @bjorn3

Some changes occurred in compiler/rustc_sanitizers

cc @rcvalle

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

This PR changes rustc_public

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

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

@rustbot rustbot added PG-exploit-mitigations Project group: Exploit mitigations 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 Jun 18, 2026
@camelid

camelid commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

Not sure if this should get an MCP; let me know.

@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

camelid added 2 commits June 19, 2026 19:11
They tend to have similar handling -- e.g., they should be the only
input to the `mir_shims` query -- so it's cleaner to group them
together. This will also make potential future refactorings easier, such
as only carrying `GenericArgsRef` for instances that actually use it
(e.g., `Item`) but not others (e.g., `CloneShim`).

Many of the shim variants still have `Shim` at the end of their names.
To make the refactoring easier and keep the diff clean, I will trim
those suffixes off in the next commit.
@rustbot

rustbot commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

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.

@rust-log-analyzer

This comment has been minimized.

It used to be much more prevalent before I extracted shims as their own enum.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PG-exploit-mitigations Project group: Exploit mitigations 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.

4 participants