]> git.proxmox.com Git - rustc.git/blobdiff - src/doc/nomicon/src/other-reprs.md
New upstream version 1.57.0+dfsg1
[rustc.git] / src / doc / nomicon / src / other-reprs.md
index 2b5a430405f243124a2704e712b11c93cdbbc6fe..fe06faf6c47a87cd3c5c97a16e3ad7884f14a3e1 100644 (file)
@@ -91,7 +91,7 @@ manipulate its tag and fields. See [the RFC][really-tagged] for details.
 
 These `repr`s have no effect on a struct.
 
-Adding an explicit `repr(u*)`, `repr(i*)`, or `repr(C)` to an enum suppresses the null-pointer optimization, like:
+Adding an explicit `repr(u*)`, `repr(i*)`, or `repr(C)` to an enum with fields suppresses the null-pointer optimization, like:
 
 ```rust
 # use std::mem::size_of;
@@ -110,6 +110,8 @@ assert_eq!(8, size_of::<MyOption<&u16>>());
 assert_eq!(16, size_of::<MyReprOption<&u16>>());
 ```
 
+This optimization still applies to fieldless enums with an explicit `repr(u*)`, `repr(i*)`, or `repr(C)`.
+
 ## repr(packed)
 
 `repr(packed)` forces Rust to strip any padding, and only align the type to a