Skip to content

Commit 53d8d84

Browse files
committed
clarification
1 parent f1064b0 commit 53d8d84

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

text/0000-maybe-dangling.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ The goal of this RFC is to
8989

9090
To handle situations like this, Rust has a special type called `MaybeDangling<P>`:
9191
references and boxes in `P` do *not* have to be dereferenceable or follow aliasing guarantees.
92+
This applies inside nested references/boxes inside `P` as well.
9293
They still have to be non-null and aligned, and it has to at least be *possible* that there exists valid data behind that reference (i.e., `MaybeDangling<&!>` is still invalid), but the rules are relaxed when compared with just a plain `P`.
9394
Also note that safe code can still generally assume that every `MaybeDangling<P>` it encounters is a valid `P`, but within unsafe code this makes it possible to store data of arbitrary type without making reference guarantees (this is similar to `ManuallyDrop`).
9495

0 commit comments

Comments
 (0)