From 340827af9bcc140cbf3273a4a7f7b2628584f7a1 Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Sun, 21 May 2023 11:34:01 -0400 Subject: [PATCH] drop_in_place docs: remove pseudocode-ish implementation details --- library/core/src/ptr/mod.rs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/library/core/src/ptr/mod.rs b/library/core/src/ptr/mod.rs index 1a5519b9307..ff9fa48f311 100644 --- a/library/core/src/ptr/mod.rs +++ b/library/core/src/ptr/mod.rs @@ -437,21 +437,7 @@ /// /// # 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. ///