rust-lang / nomicon

The Dark Arts of Advanced and Unsafe Rust Programming
https://doc.rust-lang.org/nomicon/
Apache License 2.0
1.79k stars 261 forks source link

Illustrate the transparent representation with an extended example #263

Closed markrtuttle closed 1 year ago

markrtuttle commented 3 years ago

This contribution adds an example to the section discussing the transparent representation. A misreading of the original documentation caused me to think transparent is more complicated that it really is. An example like this (the effect of transparent on wrappers around integers) would have helped me.