Skip to content

Commit df9ff37

Browse files
committed
Clarify what it means "to document" a transparent type.
1 parent cbcac21 commit df9ff37

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/doc/src/reference/semver.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ In some cases, types with a `repr` attribute may not have an alignment, layout,
265265
In these cases, it may be safe to make changes to the types, though care should be exercised.
266266
For example, types with private fields that do not otherwise document their alignment, layout, or size guarantees cannot be relied upon by external crates since the public API does not fully define the alignment, layout, or size of the type.
267267

268-
A common example where a type with *private* fields is well-defined is a type with a single private field with a generic type, using `repr(transparent)`, and which is documented as being transparent to the generic type.
268+
A common example where a type with *private* fields is well-defined is a type with a single private field with a generic type, using `repr(transparent)`,
269+
and the prose of the documentation discusses that it is transparent to the generic type.
269270
For example, see [`UnsafeCell`].
270271

271272
[the default representation]: ../../reference/type-layout.html#the-default-representation

0 commit comments

Comments
 (0)