drop_in_place docs: remove pseudocode-ish implementation details
This commit is contained in:
parent
c4d69b717f
commit
340827af9b
@ -437,21 +437,7 @@ mod mut_ptr;
|
|||||||
///
|
///
|
||||||
/// # Safety
|
/// # Safety
|
||||||
///
|
///
|
||||||
/// Immediately upon executing, `drop_in_place` takes out a mutable borrow on the
|
/// Behavior is undefined if any of the following conditions are violated:
|
||||||
/// pointed-to-value. Effectively, this function is implemented like so:
|
|
||||||
///
|
|
||||||
/// ```
|
|
||||||
/// # struct Foo { x: i32 }
|
|
||||||
/// unsafe fn drop_in_place(to_drop: *mut Foo) {
|
|
||||||
/// drop_in_place_inner(&mut *to_drop);
|
|
||||||
/// unsafe fn drop_in_place_inner(to_drop: &mut Foo) {
|
|
||||||
/// // ... drop the fields of `value` ...
|
|
||||||
/// }
|
|
||||||
/// }
|
|
||||||
/// ```
|
|
||||||
///
|
|
||||||
/// This implies that the behavior is undefined if any of the following
|
|
||||||
/// conditions are violated:
|
|
||||||
///
|
///
|
||||||
/// * `to_drop` must be [valid] for both reads and writes.
|
/// * `to_drop` must be [valid] for both reads and writes.
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user