nomicon icon indicating copy to clipboard operation
nomicon copied to clipboard

doc: improve documentation of packed type layout modifier

Open phip1611 opened this issue 4 years ago • 3 comments

~The Rust language reference (and my experience, proved by tests) says, that packed(n) gives you the ability to align the struct too. This bug probably comes from a past version of Rust, where this wasn't supported.~

Currently, the packed documentation doesn't mention the n-parameter.

https://doc.rust-lang.org/reference/type-layout.html

phip1611 avatar Oct 07 '21 18:10 phip1611

I updated the PR @ehuss . See the latest version here: https://github.com/rust-lang/nomicon/blob/20d86cd0331e1c54bfd85e25326e3e0e41fc979e/src/other-reprs.md

Any more comments?

phip1611 avatar Nov 09 '21 15:11 phip1611

Sorry for the circumstances on this, I obviously understood something wrong. I tried to improve the description in a way, that others will not fall for the same misleading assumption as me. @ehuss

phip1611 avatar Dec 08 '21 10:12 phip1611

@ehuss I rebased the PR branch onto the latest master branch.

phip1611 avatar Jan 31 '22 21:01 phip1611