You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/destructors.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ dropped.
11
11
r[destructors.operation]
12
12
The destructor of a type `T` consists of:
13
13
14
-
1. If `T: Drop`, calling [`<T as std::ops::Drop>::drop`](std::ops::Drop::drop)
14
+
1. If `T: Drop`, calling [`<T as core::ops::Drop>::drop`](core::ops::Drop::drop)
15
15
2. Recursively running the destructor of all of its fields.
16
16
* The fields of a [struct] are dropped in declaration order.
17
17
* The fields of the active [enum variant] are dropped in declaration order.
@@ -25,7 +25,7 @@ The destructor of a type `T` consists of:
25
25
26
26
r[destructors.drop_in_place]
27
27
If a destructor must be run manually, such as when implementing your own smart
28
-
pointer, [`std::ptr::drop_in_place`] can be used.
28
+
pointer, [`core::ptr::drop_in_place`] can be used.
29
29
30
30
Some examples:
31
31
@@ -626,12 +626,12 @@ r[destructors.forget]
626
626
r[destructors.manually-suppressing]
627
627
### Manually suppressing destructors
628
628
629
-
[`std::mem::forget`] can be used to prevent the destructor of a variable from being run,
630
-
and [`std::mem::ManuallyDrop`] provides a wrapper to prevent a
629
+
[`core::mem::forget`] can be used to prevent the destructor of a variable from being run,
630
+
and [`core::mem::ManuallyDrop`] provides a wrapper to prevent a
631
631
variable or field from being dropped automatically.
632
632
633
633
> [!NOTE]
634
-
> Preventing a destructor from being run via [`std::mem::forget`] or other means is safe even if it has a type that isn't `'static`. Besides the places where destructors are guaranteed to run as defined by this document, types may *not* safely rely on a destructor being run for soundness.
634
+
> Preventing a destructor from being run via [`core::mem::forget`] or other means is safe even if it has a type that isn't `'static`. Besides the places where destructors are guaranteed to run as defined by this document, types may *not* safely rely on a destructor being run for soundness.
0 commit comments