about summary refs log tree commit diff
path: root/library/core/src
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-05-30 09:07:06 +0200
committerRalf Jung <post@ralfj.de>2024-05-30 09:07:06 +0200
commit5c68a15e41a4e2fe792508ec130c3659b198db3d (patch)
tree25bfa036770926de770be25acfd442ff184e4bf3 /library/core/src
parent5c497cb3f08d729206726e659d17ce1168327949 (diff)
downloadrust-5c68a15e41a4e2fe792508ec130c3659b198db3d.tar.gz
rust-5c68a15e41a4e2fe792508ec130c3659b198db3d.zip
explain what the open questions are, and add a Miri test for that
Diffstat (limited to 'library/core/src')
-rw-r--r--library/core/src/ptr/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs
index 51eb2bb4f0e..335fc861ae8 100644
--- a/library/core/src/ptr/mod.rs
+++ b/library/core/src/ptr/mod.rs
@@ -452,6 +452,11 @@ mod mut_ptr;
 ///
 /// This is almost the same as calling [`ptr::read`] and discarding
 /// the result, but has the following advantages:
+// FIXME: say something more useful than "almost the same"?
+// There are open questions here: `read` requires the value to be fully valid, e.g. if `T` is a
+// `bool` it must be 0 or 1, if it is a reference then it must be dereferenceable. `drop_in_place`
+// only requires that `*to_drop` be "valid for dropping" and we have not defined what that means. In
+// Miri it currently (May 2024) requires nothing at all for types without drop glue.
 ///
 /// * It is *required* to use `drop_in_place` to drop unsized types like
 ///   trait objects, because they can't be read out onto the stack and