You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/coding-guidelines/values.rst
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
Values
7
7
======
8
8
9
-
.. guideline:: Do not create values from uninitialized memory
9
+
.. guideline:: Do not create values from or read uninitialized memory
10
10
:id: gui_uyp3mCj77FS8
11
11
:category: required
12
12
:status: draft
@@ -17,10 +17,10 @@ Values
17
17
:tags: undefined-behavior, unsafe, defect
18
18
19
19
Do not create a typed value from uninitialized memory.
20
-
Types that explicitly permit an uninitialized state (e.g., ``MaybeUninit<T>`` or a union that includes ``()``) may hold uninitialized bytes as values,
20
+
Types that explicitly permit an uninitialized state (e.g., ``MaybeUninit<T>`` or a ``union`` that includes ``()``) may hold uninitialized bytes as values,
21
21
but reading any specific typed field still requires initialized and valid bytes.
22
22
23
-
**Exception:** You can access a field of a union when all of the following conditions are met:
23
+
**Exception:** You can access a field of a ``union`` when all of the following conditions are met:
24
24
25
25
- All bytes of the field read have been initialized by a prior write.
26
26
- The bytes form a valid representation for the field's type
0 commit comments