rust-lang / nomicon

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

Clarify repr(transparent) in other-reprs #329

Closed nico-abram closed 2 years ago

nico-abram commented 2 years ago

This clarifies that UnsafeCell is not just repr(transparent), since it does not propagate niches the same as it's inner type, and also mentions when it can be relied on by other crates.

For some discussion on that second point, see this issue https://github.com/rust-lang/rust/issues/90435

nico-abram commented 2 years ago

Applied suggested changes. I can squash if needed

JohnTitor commented 2 years ago

Applied suggested changes. I can squash if needed

Thanks! Don't worry, we can squash them when merging :)