We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40ca167 commit 943e653Copy full SHA for 943e653
src/libcore/ptr/mod.rs
@@ -119,10 +119,13 @@ mod mut_ptr;
119
///
120
/// Behavior is undefined if any of the following conditions are violated:
121
122
-/// * `to_drop` must be [valid] for reads.
+/// * `to_drop` must be [valid] for both reads and writes.
123
124
/// * `to_drop` must be properly aligned.
125
126
+/// * The value `to_drop` points to must be valid for dropping, which may mean it must uphold
127
+/// additional invariants - this is type-dependent.
128
+///
129
/// Additionally, if `T` is not [`Copy`], using the pointed-to value after
130
/// calling `drop_in_place` can cause undefined behavior. Note that `*to_drop =
131
/// foo` counts as a use because it will cause the value to be dropped
0 commit comments