rust-lang / reference

The Rust Reference
https://doc.rust-lang.org/nightly/reference/
Apache License 2.0
1.25k stars 493 forks source link

Tweak `repr(transparent)` to mention requiring *at most* one non-1-ZST #1568

Closed compiler-errors closed 3 months ago

compiler-errors commented 3 months ago

https://github.com/rust-lang/rust/issues/77841#issuecomment-716575747 FCP'd a modification to the specification of repr(transparent) to check for at most one non-1-ZST field in repr(transparent).

This was changed in the compiler in: https://github.com/rust-lang/rust/pull/86279

The reference was never updated, leading to confusion: https://github.com/rust-lang/rust/issues/129029

traviscross commented 3 months ago

Thanks @compiler-errors.