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/behavior-considered-undefined.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,8 @@ r[undefined.alias]
38
38
`&T` must point to memory that is not mutated while they are live (except for data inside an [`UnsafeCell<U>`]),
39
39
and `&mut T` must point to memory that is not read or written by any pointer not derived from the reference and that no other reference points to while they are live.
40
40
`Box<T>` is treated similar to `&'static mut T` for the purpose of these rules.
41
+
These rules apply to *all* references and `Box<T>`, including those inside private fields.
42
+
41
43
The exact liveness duration is not specified, but some bounds exist:
42
44
* For references, the liveness duration is upper-bounded by the syntactic
43
45
lifetime assigned by the borrow checker; it cannot be live any *longer* than that lifetime.
0 commit comments