Skip to content

Commit 14d5dcb

Browse files
committed
explain what the open questions are, and add a Miri test for that
1 parent 07d3009 commit 14d5dcb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/ptr/mod.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,11 @@ mod mut_ptr;
452452
///
453453
/// This is almost the same as calling [`ptr::read`] and discarding
454454
/// the result, but has the following advantages:
455+
// FIXME: say something more useful than "almost the same"?
456+
// There are open questions here: `read` requires the value to be fully valid, e.g. if `T` is a
457+
// `bool` it must be 0 or 1, if it is a reference then it must be dereferenceable. `drop_in_place`
458+
// only requires that `*to_drop` be "valid for dropping" and we have not defined what that means. In
459+
// Miri it currently (May 2024) requires nothing at all for types without drop glue.
455460
///
456461
/// * It is *required* to use `drop_in_place` to drop unsized types like
457462
/// trait objects, because they can't be read out onto the stack and

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy