Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions library/core/src/cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2053,6 +2053,8 @@ impl<T: ?Sized> UnsafeCell<T> {
///
/// let m = MaybeUninit::<UnsafeCell<i32>>::uninit();
/// unsafe { UnsafeCell::raw_get(m.as_ptr()).write(5); }
/// // avoid below which references to uninitialized data
/// // unsafe { UnsafeCell::get(&*m.as_ptr()).write(5); }
Comment on lines +2056 to +2057
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has a mildly "don't think of the pink elephant" quality but it is probably still better to have a "don't do this" than not.

/// let uc = unsafe { m.assume_init() };
///
/// assert_eq!(uc.into_inner(), 5);
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/panic/panic_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl<'a> PanicInfo<'a> {
/// whose ABI does not support unwinding.
///
/// It is safe for a panic handler to unwind even when this function returns
/// true, however this will simply cause the panic handler to be called
/// false, however this will simply cause the panic handler to be called
/// again.
#[must_use]
#[unstable(feature = "panic_can_unwind", issue = "92988")]
Expand Down