Skip to content

Commit a057fa2

Browse files
committed
Link to struct chapter
1 parent e88dc3d commit a057fa2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: reference/src/layout/unions.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ assert_eq!(size_of::<U>(), 2);
8585
# }
8686
```
8787

88-
**C++ compatibility hazard**: C++ does, in general, give a size of 1 to empty
89-
structs. If an empty struct in C++ is used as an union field, a "naive"
90-
translation of that code into Rust will not produce a compatible result.
88+
**C++ compatibility hazard**: C++ does, in general, give a size of 1 to types
89+
with no fields. When such types are used as an union field in C++, a "naive"
90+
translation of that code into Rust will not produce a compatible result. Refer
91+
to the [struct chapter](structs-and-tuples.md#c-compatible-layout-repr-c) for
92+
further details.

0 commit comments

Comments
 (0)