Skip to content

interpret: correctly deal with repr(transparent) enums#156105

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:transparent-enums
May 6, 2026
Merged

interpret: correctly deal with repr(transparent) enums#156105
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:transparent-enums

Conversation

@RalfJung
Copy link
Copy Markdown
Member

@RalfJung RalfJung commented May 3, 2026

@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 3, 2026

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @oli-obk, @lcnr

@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 May 3, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 3, 2026

r? @nikomatsakis

rustbot has assigned @nikomatsakis.
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, mir
  • compiler, mir expanded to 73 candidates
  • Random selection from 22 candidates

@lcnr
Copy link
Copy Markdown
Contributor

lcnr commented May 5, 2026

r? lcnr

@bors r+ rollup

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented May 5, 2026

📌 Commit a6d6601 has been approved by lcnr

It is now in the queue for this repository.

@rustbot rustbot assigned lcnr and unassigned nikomatsakis May 5, 2026
@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 May 5, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request May 5, 2026
interpret: correctly deal with repr(transparent) enums

Fixes rust-lang/miri#4998
jhpratt added a commit to jhpratt/rust that referenced this pull request May 5, 2026
interpret: correctly deal with repr(transparent) enums

Fixes rust-lang/miri#4998
rust-bors Bot pushed a commit that referenced this pull request May 5, 2026
Rollup of 12 pull requests

Successful merges:

 - #155341 (generic_const_args: allow paths to non type consts)
 - #156062 (Added command-line argument support for `wasm32-wali-linux-musl`)
 - #156159 ([AIX] add -bdbg:namedsects:ss link arg)
 - #156174 (Wasm: remove implicit `__heap_base`/`__data_end` exports)
 - #156186 (fix: remap ci-llvm debug paths via `-ffile-prefix-map`)
 - #156193 (port `rustc_ast*` crates from `box_` to `deref_patterns`)
 - #156201 (Don't run ui-fulldeps tests twice in stage 1)
 - #155808 (Always use `ConstFn` context for `const` closures)
 - #156105 (interpret: correctly deal with repr(transparent) enums)
 - #156148 (Use `all_impls` instead of handrolling it)
 - #156156 (Adjust getMCSubtargetInfo signature for LLVM 23+)
 - #156205 (move generalization test)
rust-bors Bot pushed a commit that referenced this pull request May 6, 2026
Rollup of 15 pull requests

Successful merges:

 - #151122 (fix: more descriptive error message for enum to integer)
 - #155341 (generic_const_args: allow paths to non type consts)
 - #156062 (Added command-line argument support for `wasm32-wali-linux-musl`)
 - #156159 ([AIX] add -bdbg:namedsects:ss link arg)
 - #156174 (Wasm: remove implicit `__heap_base`/`__data_end` exports)
 - #156186 (fix: remap ci-llvm debug paths via `-ffile-prefix-map`)
 - #156193 (port `rustc_ast*` crates from `box_` to `deref_patterns`)
 - #156201 (Don't run ui-fulldeps tests twice in stage 1)
 - #155808 (Always use `ConstFn` context for `const` closures)
 - #156105 (interpret: correctly deal with repr(transparent) enums)
 - #156148 (Use `all_impls` instead of handrolling it)
 - #156156 (Adjust getMCSubtargetInfo signature for LLVM 23+)
 - #156170 (add known-bug test for coroutine 'static-yields-non-'static unsoundness (#144442))
 - #156195 (Move tests codegen)
 - #156205 (move generalization test)
rust-bors Bot pushed a commit that referenced this pull request May 6, 2026
Rollup of 15 pull requests

Successful merges:

 - #151122 (fix: more descriptive error message for enum to integer)
 - #155341 (generic_const_args: allow paths to non type consts)
 - #156062 (Added command-line argument support for `wasm32-wali-linux-musl`)
 - #156159 ([AIX] add -bdbg:namedsects:ss link arg)
 - #156174 (Wasm: remove implicit `__heap_base`/`__data_end` exports)
 - #156186 (fix: remap ci-llvm debug paths via `-ffile-prefix-map`)
 - #156193 (port `rustc_ast*` crates from `box_` to `deref_patterns`)
 - #156201 (Don't run ui-fulldeps tests twice in stage 1)
 - #155808 (Always use `ConstFn` context for `const` closures)
 - #156105 (interpret: correctly deal with repr(transparent) enums)
 - #156148 (Use `all_impls` instead of handrolling it)
 - #156156 (Adjust getMCSubtargetInfo signature for LLVM 23+)
 - #156170 (add known-bug test for coroutine 'static-yields-non-'static unsoundness (#144442))
 - #156195 (Move tests codegen)
 - #156205 (move generalization test)
rust-bors Bot pushed a commit that referenced this pull request May 6, 2026
Rollup of 15 pull requests

Successful merges:

 - #151122 (fix: more descriptive error message for enum to integer)
 - #155341 (generic_const_args: allow paths to non type consts)
 - #156062 (Added command-line argument support for `wasm32-wali-linux-musl`)
 - #156159 ([AIX] add -bdbg:namedsects:ss link arg)
 - #156174 (Wasm: remove implicit `__heap_base`/`__data_end` exports)
 - #156186 (fix: remap ci-llvm debug paths via `-ffile-prefix-map`)
 - #156193 (port `rustc_ast*` crates from `box_` to `deref_patterns`)
 - #156201 (Don't run ui-fulldeps tests twice in stage 1)
 - #155808 (Always use `ConstFn` context for `const` closures)
 - #156105 (interpret: correctly deal with repr(transparent) enums)
 - #156148 (Use `all_impls` instead of handrolling it)
 - #156156 (Adjust getMCSubtargetInfo signature for LLVM 23+)
 - #156170 (add known-bug test for coroutine 'static-yields-non-'static unsoundness (#144442))
 - #156195 (Move tests codegen)
 - #156205 (move generalization test)
@rust-bors rust-bors Bot merged commit 38bbf33 into rust-lang:main May 6, 2026
11 checks passed
rust-timer added a commit that referenced this pull request May 6, 2026
Rollup merge of #156105 - RalfJung:transparent-enums, r=lcnr

interpret: correctly deal with repr(transparent) enums

Fixes rust-lang/miri#4998
pull Bot pushed a commit to xtqqczze/rust-lang-miri that referenced this pull request May 7, 2026
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#151122 (fix: more descriptive error message for enum to integer)
 - rust-lang/rust#155341 (generic_const_args: allow paths to non type consts)
 - rust-lang/rust#156062 (Added command-line argument support for `wasm32-wali-linux-musl`)
 - rust-lang/rust#156159 ([AIX] add -bdbg:namedsects:ss link arg)
 - rust-lang/rust#156174 (Wasm: remove implicit `__heap_base`/`__data_end` exports)
 - rust-lang/rust#156186 (fix: remap ci-llvm debug paths via `-ffile-prefix-map`)
 - rust-lang/rust#156193 (port `rustc_ast*` crates from `box_` to `deref_patterns`)
 - rust-lang/rust#156201 (Don't run ui-fulldeps tests twice in stage 1)
 - rust-lang/rust#155808 (Always use `ConstFn` context for `const` closures)
 - rust-lang/rust#156105 (interpret: correctly deal with repr(transparent) enums)
 - rust-lang/rust#156148 (Use `all_impls` instead of handrolling it)
 - rust-lang/rust#156156 (Adjust getMCSubtargetInfo signature for LLVM 23+)
 - rust-lang/rust#156170 (add known-bug test for coroutine 'static-yields-non-'static unsoundness (rust-lang/rust#144442))
 - rust-lang/rust#156195 (Move tests codegen)
 - rust-lang/rust#156205 (move generalization test)
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request May 8, 2026
Rollup of 15 pull requests

Successful merges:

 - rust-lang/rust#151122 (fix: more descriptive error message for enum to integer)
 - rust-lang/rust#155341 (generic_const_args: allow paths to non type consts)
 - rust-lang/rust#156062 (Added command-line argument support for `wasm32-wali-linux-musl`)
 - rust-lang/rust#156159 ([AIX] add -bdbg:namedsects:ss link arg)
 - rust-lang/rust#156174 (Wasm: remove implicit `__heap_base`/`__data_end` exports)
 - rust-lang/rust#156186 (fix: remap ci-llvm debug paths via `-ffile-prefix-map`)
 - rust-lang/rust#156193 (port `rustc_ast*` crates from `box_` to `deref_patterns`)
 - rust-lang/rust#156201 (Don't run ui-fulldeps tests twice in stage 1)
 - rust-lang/rust#155808 (Always use `ConstFn` context for `const` closures)
 - rust-lang/rust#156105 (interpret: correctly deal with repr(transparent) enums)
 - rust-lang/rust#156148 (Use `all_impls` instead of handrolling it)
 - rust-lang/rust#156156 (Adjust getMCSubtargetInfo signature for LLVM 23+)
 - rust-lang/rust#156170 (add known-bug test for coroutine 'static-yields-non-'static unsoundness (rust-lang/rust#144442))
 - rust-lang/rust#156195 (Move tests codegen)
 - rust-lang/rust#156205 (move generalization test)
@RalfJung RalfJung deleted the transparent-enums branch May 9, 2026 11:11
@Kobzol
Copy link
Copy Markdown
Member

Kobzol commented May 12, 2026

@rust-timer build 918aaa3

Testing for #156217.

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (918aaa3): comparison URL.

Overall result: ❌✅ regressions and improvements - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.7% [0.0%, 1.0%] 8
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.0% [-0.1%, -0.0%] 3
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results (primary 2.2%, secondary -0.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.2% [2.2%, 2.2%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.8% [-1.4%, -0.4%] 4
All ❌✅ (primary) 2.2% [2.2%, 2.2%] 1

Cycles

Results (secondary 0.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
0.8% [0.4%, 1.1%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.4% [-0.4%, -0.4%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.1%, secondary 0.1%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.1%] 31
Regressions ❌
(secondary)
0.1% [0.0%, 0.1%] 21
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.1% [0.0%, 0.1%] 31

Bootstrap: 493.455s -> 494.183s (0.15%)
Artifact size: 394.43 MiB -> 396.48 MiB (0.52%)

@rustbot rustbot added the perf-regression Performance regression. label May 12, 2026
@Kobzol
Copy link
Copy Markdown
Member

Kobzol commented May 12, 2026

Huh, this seems to have the same regression as #155808.

@RalfJung
Copy link
Copy Markdown
Member Author

Probably flaky tests that keep flipping between two states.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. 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.

Miri ICEs on repr(transparent) enums

6 participants