Skip to content

Commit baf3d9c

Browse files
committed
to Deref or not to Deref
1 parent d28f052 commit baf3d9c

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
@@ -240,6 +240,7 @@ Notice that `UnsafeCell` acts "behind references" while `MaybeDangling`, like `M
240240
`MaybeDangling` is somewhat misleading since the safety invariant still requires everything to be dereferenceable, only the validity invariant is relaxed.
241241
This is a bit like `ManuallyDrop` which supports dropping via an `unsafe` function but its safety invariant says that the data is not dropped (so that it can implement `Deref` and `DerefMut` and a safe `into_inner`).
242242
Furthermore, the type also allows maybe-aliasing references, not just maybe-dangling references.
243+
- Should `MaybeDangling` implement `Deref` and `DerefMut` like `ManuallyDrop` does, or should accessing the inner data be more explicit since that is when the aliasing and validity requirements do come back in full force?
243244

244245
# Future possibilities
245246
[future-possibilities]: #future-possibilities

0 commit comments

Comments
 (0)