Skip to content

interpret: ensure newly created unions have uninit in their padding - #165682

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:union-init
Nov 10, 2026
Merged

rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
RalfJung:union-init

Conversation

@RalfJung

@RalfJung RalfJung commented Nov 9, 2026

Copy link
Copy Markdown
Member

@rustbot

rustbot commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @oli-obk, @lcnr

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

@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 Nov 9, 2026
@RalfJung
RalfJung force-pushed the union-init branch 3 times, most recently from 38c1a95 to 49682e4 Compare November 9, 2026 17:14
@oli-obk

oli-obk commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@bors r+ rollup

@rust-bors

rust-bors Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

📌 Commit e7007d3 has been approved by oli-obk

It is now in the queue for this repository.

@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 Nov 10, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 10, 2026
interpret: ensure newly created unions have uninit in their padding

Fixes rust-lang/miri#5554

r? @oli-obk
rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #165575 (Upgrade bundled musl to 1.2.6)
 - #163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - #165117 (std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims)
 - #165458 (fix incorrect byte count suffix on MSVC)
 - #165487 (Migrate built-in macros `pattern_type` & `view_type` to macros 2.0 that expand to internal syntax)
 - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - #165586 (Remove `backend_optimization_level`.)
 - #165646 (fix NumScalableVectors::from_field_count)
 - #165655 (Unignore passing GCC backend tests)
 - #165740 (miri subtree update)
 - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - #165682 (interpret: ensure newly created unions have uninit in their padding)
 - #165693 (Move `check_attr` to attribute parsing)
 - #165715 (windows: check for null before wide encoding)
 - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - #165733 (docs(num): remove needless whitespaces)

Failed merges:

 - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - #164218 (Tweak private re-export errors to point at correct span and have more context)
 - #165709 (remove 'x miri' smoke test from PR CI)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 10, 2026
interpret: ensure newly created unions have uninit in their padding

Fixes rust-lang/miri#5554

r? @oli-obk
rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
…uwer

Rollup of 16 pull requests

Successful merges:

 - #165575 (Upgrade bundled musl to 1.2.6)
 - #163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - #165117 (std: use skip_unsupported_miri_tests to control when tests should be skipped in Miri due to missing shims)
 - #165458 (fix incorrect byte count suffix on MSVC)
 - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - #165586 (Remove `backend_optimization_level`.)
 - #165646 (fix NumScalableVectors::from_field_count)
 - #165655 (Unignore passing GCC backend tests)
 - #165740 (miri subtree update)
 - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - #165682 (interpret: ensure newly created unions have uninit in their padding)
 - #165693 (Move `check_attr` to attribute parsing)
 - #165715 (windows: check for null before wide encoding)
 - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - #165733 (docs(num): remove needless whitespaces)

Failed merges:

 - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - #164218 (Tweak private re-export errors to point at correct span and have more context)
 - #165709 (remove 'x miri' smoke test from PR CI)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 10, 2026
interpret: ensure newly created unions have uninit in their padding

Fixes rust-lang/miri#5554

r? @oli-obk
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Nov 10, 2026
interpret: ensure newly created unions have uninit in their padding

Fixes rust-lang/miri#5554

r? @oli-obk
rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #165709 (remove 'x miri' smoke test from PR CI)
 - #164217 (Prepare to make `rustc_trivial_field_reads` usable in user code)
 - #165569 (`Move` trait feature gate)
 - #165575 (Upgrade bundled musl to 1.2.6)
 - #163241 (Add enclosing item context when pointing at `FnMut` bound)
 - #163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - #165047 (Change the span building of paths from first-to-last to chained)
 - #165458 (fix incorrect byte count suffix on MSVC)
 - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - #165586 (Remove `backend_optimization_level`.)
 - #165646 (fix NumScalableVectors::from_field_count)
 - #165655 (Unignore passing GCC backend tests)
 - #165740 (miri subtree update)
 - #165753 (avoid Terminator:None in MIR inliner)
 - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - #165562 (stop using gce in a test)
 - #165681 (Add safety requirements for Pattern and Searcher)
 - #165682 (interpret: ensure newly created unions have uninit in their padding)
 - #165693 (Move `check_attr` to attribute parsing)
 - #165715 (windows: check for null before wide encoding)
 - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - #165733 (docs(num): remove needless whitespaces)
 - #165739 (remove NOP File::flush from fs tests)

Failed merges:

 - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - #164218 (Tweak private re-export errors to point at correct span and have more context)
rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - #165709 (remove 'x miri' smoke test from PR CI)
 - #164217 (Prepare to make `rustc_trivial_field_reads` usable in user code)
 - #165569 (`Move` trait feature gate)
 - #165575 (Upgrade bundled musl to 1.2.6)
 - #163241 (Add enclosing item context when pointing at `FnMut` bound)
 - #163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - #165047 (Change the span building of paths from first-to-last to chained)
 - #165458 (fix incorrect byte count suffix on MSVC)
 - #165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - #165586 (Remove `backend_optimization_level`.)
 - #165646 (fix NumScalableVectors::from_field_count)
 - #165655 (Unignore passing GCC backend tests)
 - #165740 (miri subtree update)
 - #165753 (avoid Terminator:None in MIR inliner)
 - #153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - #164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - #165562 (stop using gce in a test)
 - #165681 (Add safety requirements for Pattern and Searcher)
 - #165682 (interpret: ensure newly created unions have uninit in their padding)
 - #165693 (Move `check_attr` to attribute parsing)
 - #165715 (windows: check for null before wide encoding)
 - #165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - #165733 (docs(num): remove needless whitespaces)
 - #165739 (remove NOP File::flush from fs tests)

Failed merges:

 - #165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - #164218 (Tweak private re-export errors to point at correct span and have more context)
@rust-bors
rust-bors Bot merged commit 64fe2a9 into rust-lang:main Nov 10, 2026
14 checks passed
@rustbot rustbot added this to the 1.102.0 milestone Nov 10, 2026
rust-bors Bot pushed a commit that referenced this pull request Nov 10, 2026
Rollup merge of #165682 - RalfJung:union-init, r=oli-obk

interpret: ensure newly created unions have uninit in their padding

Fixes rust-lang/miri#5554

r? @oli-obk
@RalfJung
RalfJung deleted the union-init branch November 10, 2026 20:34
bjorn3 pushed a commit to rust-lang/rustc_codegen_cranelift that referenced this pull request Nov 11, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - rust-lang/rust#165709 (remove 'x miri' smoke test from PR CI)
 - rust-lang/rust#164217 (Prepare to make `rustc_trivial_field_reads` usable in user code)
 - rust-lang/rust#165569 (`Move` trait feature gate)
 - rust-lang/rust#165575 (Upgrade bundled musl to 1.2.6)
 - rust-lang/rust#163241 (Add enclosing item context when pointing at `FnMut` bound)
 - rust-lang/rust#163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - rust-lang/rust#165047 (Change the span building of paths from first-to-last to chained)
 - rust-lang/rust#165458 (fix incorrect byte count suffix on MSVC)
 - rust-lang/rust#165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - rust-lang/rust#165586 (Remove `backend_optimization_level`.)
 - rust-lang/rust#165646 (fix NumScalableVectors::from_field_count)
 - rust-lang/rust#165655 (Unignore passing GCC backend tests)
 - rust-lang/rust#165740 (miri subtree update)
 - rust-lang/rust#165753 (avoid Terminator:None in MIR inliner)
 - rust-lang/rust#153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - rust-lang/rust#164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - rust-lang/rust#165562 (stop using gce in a test)
 - rust-lang/rust#165681 (Add safety requirements for Pattern and Searcher)
 - rust-lang/rust#165682 (interpret: ensure newly created unions have uninit in their padding)
 - rust-lang/rust#165693 (Move `check_attr` to attribute parsing)
 - rust-lang/rust#165715 (windows: check for null before wide encoding)
 - rust-lang/rust#165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - rust-lang/rust#165733 (docs(num): remove needless whitespaces)
 - rust-lang/rust#165739 (remove NOP File::flush from fs tests)

Failed merges:

 - rust-lang/rust#165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - rust-lang/rust#164218 (Tweak private re-export errors to point at correct span and have more context)
RalfJung pushed a commit to mehmettoplu-rs/miri that referenced this pull request Nov 11, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - rust-lang/rust#165709 (remove 'x miri' smoke test from PR CI)
 - rust-lang/rust#164217 (Prepare to make `rustc_trivial_field_reads` usable in user code)
 - rust-lang/rust#165569 (`Move` trait feature gate)
 - rust-lang/rust#165575 (Upgrade bundled musl to 1.2.6)
 - rust-lang/rust#163241 (Add enclosing item context when pointing at `FnMut` bound)
 - rust-lang/rust#163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - rust-lang/rust#165047 (Change the span building of paths from first-to-last to chained)
 - rust-lang/rust#165458 (fix incorrect byte count suffix on MSVC)
 - rust-lang/rust#165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - rust-lang/rust#165586 (Remove `backend_optimization_level`.)
 - rust-lang/rust#165646 (fix NumScalableVectors::from_field_count)
 - rust-lang/rust#165655 (Unignore passing GCC backend tests)
 - rust-lang/rust#165740 (miri subtree update)
 - rust-lang/rust#165753 (avoid Terminator:None in MIR inliner)
 - rust-lang/rust#153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - rust-lang/rust#164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - rust-lang/rust#165562 (stop using gce in a test)
 - rust-lang/rust#165681 (Add safety requirements for Pattern and Searcher)
 - rust-lang/rust#165682 (interpret: ensure newly created unions have uninit in their padding)
 - rust-lang/rust#165693 (Move `check_attr` to attribute parsing)
 - rust-lang/rust#165715 (windows: check for null before wide encoding)
 - rust-lang/rust#165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - rust-lang/rust#165733 (docs(num): remove needless whitespaces)
 - rust-lang/rust#165739 (remove NOP File::flush from fs tests)

Failed merges:

 - rust-lang/rust#165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - rust-lang/rust#164218 (Tweak private re-export errors to point at correct span and have more context)
github-actions Bot pushed a commit to rust-lang/stdarch that referenced this pull request Nov 12, 2026
…uwer

Rollup of 24 pull requests

Successful merges:

 - rust-lang/rust#165709 (remove 'x miri' smoke test from PR CI)
 - rust-lang/rust#164217 (Prepare to make `rustc_trivial_field_reads` usable in user code)
 - rust-lang/rust#165569 (`Move` trait feature gate)
 - rust-lang/rust#165575 (Upgrade bundled musl to 1.2.6)
 - rust-lang/rust#163241 (Add enclosing item context when pointing at `FnMut` bound)
 - rust-lang/rust#163992 (add `core::arch::{x86, x86_64}::x87_f80`)
 - rust-lang/rust#165047 (Change the span building of paths from first-to-last to chained)
 - rust-lang/rust#165458 (fix incorrect byte count suffix on MSVC)
 - rust-lang/rust#165490 (Mark the compile unit for `-Zdebuginfo-for-profiling`)
 - rust-lang/rust#165586 (Remove `backend_optimization_level`.)
 - rust-lang/rust#165646 (fix NumScalableVectors::from_field_count)
 - rust-lang/rust#165655 (Unignore passing GCC backend tests)
 - rust-lang/rust#165740 (miri subtree update)
 - rust-lang/rust#165753 (avoid Terminator:None in MIR inliner)
 - rust-lang/rust#153261 (Partially stabilize `ptr_alignment_type` as `alignment_type`)
 - rust-lang/rust#164559 (Windows: fix Dir::remove and Dir::rename following symlinks)
 - rust-lang/rust#165562 (stop using gce in a test)
 - rust-lang/rust#165681 (Add safety requirements for Pattern and Searcher)
 - rust-lang/rust#165682 (interpret: ensure newly created unions have uninit in their padding)
 - rust-lang/rust#165693 (Move `check_attr` to attribute parsing)
 - rust-lang/rust#165715 (windows: check for null before wide encoding)
 - rust-lang/rust#165717 (mpsc_sync::stream_send_recv_stress: wait for all threads to finish)
 - rust-lang/rust#165733 (docs(num): remove needless whitespaces)
 - rust-lang/rust#165739 (remove NOP File::flush from fs tests)

Failed merges:

 - rust-lang/rust#165727 (Normalize "beta release channel" in `const-supertrait-unstable` test)
 - rust-lang/rust#164218 (Tweak private re-export errors to point at correct span and have more context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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 and MiniRust disagree about whether union aggregate assignment is "a typed copy of a new value"

3 participants