Skip to content

Commit

Permalink
drop_in_place docs: remove pseudocode-ish implementation details
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdesjardins committed May 21, 2023
1 parent c4d69b7 commit 340827a
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions library/core/src/ptr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,21 +437,7 @@ mod mut_ptr;
///
/// # Safety
///
/// Immediately upon executing, `drop_in_place` takes out a mutable borrow on the
/// 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:
/// Behavior is undefined if any of the following conditions are violated:
///
/// * `to_drop` must be [valid] for both reads and writes.
///
Expand Down

0 comments on commit 340827a

Please sign in to comment.