Skip to content

Commit 3434856

Browse files
Document ManuallyDrop and AssertUnwindSafe impls
1 parent 2a02903 commit 3434856

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

library/core/src/mem/manually_drop.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
277277
#[unstable(feature = "deref_pure_trait", issue = "87121")]
278278
unsafe impl<T: ?Sized> DerefPure for ManuallyDrop<T> {}
279279

280+
/// If a value's type is `Copy`, then it has a trivial destructor,
281+
/// so wrapping it in `ManuallyDrop` can never have undesired effects.
280282
#[stable(feature = "from_wrapper_impls", since = "CURRENT_RUSTC_VERSION")]
281283
impl<T> From<T> for ManuallyDrop<T>
282284
where

library/core/src/panic/unwind_safe.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,8 @@ impl<S: AsyncIterator> AsyncIterator for AssertUnwindSafe<S> {
312312
}
313313
}
314314

315+
/// If a value's type is already `UnwindSafe`,
316+
/// wrapping it in `AssertUnwindSafe` is never incorrect.
315317
#[stable(feature = "from_wrapper_impls", since = "CURRENT_RUSTC_VERSION")]
316318
impl<T> From<T> for AssertUnwindSafe<T>
317319
where

0 commit comments

Comments
 (0)