Files
rust/compiler/rustc_abi
Jacob Pratt 9e78c8b5b9 Rollup merge of #157905 - zachs18:randomize-layout-zst-note, r=davidtwco
Update comments and add tests for `-Zrandomize-layout` for some guaranteed ZSTs

See https://github.com/rust-lang/reference/pull/2262 . T-lang wants to make some additional guarantees about zero-sized `repr(Rust)` structs and enums, that changes to `-Zrandomize-layout` could theoretically break in the future. This PR adds comments to `-Zrandomize-layout`'s implementation and tests to `tests/ui/layout/randomize.rs` to prevent breaking those guarantees.

First commit is the guarantees that T-lang already FCP'd in https://github.com/rust-lang/reference/pull/2262 .
Second commit is an additional guarantee (that zero-variant repr(Rust) enums are ZSTs) that's at https://github.com/rust-lang/reference/pull/2293 (FCP now completed)
2026-07-23 19:18:36 -04:00
..