mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 11:05:36 +00:00
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)