Files
rust/compiler/rustc_codegen_ssa
Jacob Pratt a2cc15f20e Rollup merge of #159466 - folkertdev:clear-variant-dependent-padding, r=davidtwco
cmse: clear variant-dependent padding in `enum`s

tracking issue: https://github.com/rust-lang/rust/issues/81391
tracking issue: https://github.com/rust-lang/rust/issues/75835

Since https://github.com/rust-lang/rust/pull/157397 we clear variant-independent padding, bytes that are padding for all valid values of the type. This PR extends that idea to also clear variant-dependent padding, where we have to check what variant a (nested) enum has to determine which bytes are padding so we can clear them.

With these changes the lint from https://github.com/rust-lang/rust/pull/147697 can lint on just `union`s.

r? @davidtwco
cc @RalfJung @Jules-Bertholet
2026-07-23 19:18:35 -04:00
..