Skip to content

Commit 1190c91

Browse files
committed
improve doc test for UnsafeCell::raw_get and fix docs error
1 parent d583342 commit 1190c91

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

library/core/src/cell.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2053,6 +2053,8 @@ impl<T: ?Sized> UnsafeCell<T> {
20532053
///
20542054
/// let m = MaybeUninit::<UnsafeCell<i32>>::uninit();
20552055
/// unsafe { UnsafeCell::raw_get(m.as_ptr()).write(5); }
2056+
/// // avoid below which references to uninitialized data
2057+
/// // unsafe { UnsafeCell::get(&*m.as_ptr()).write(5); }
20562058
/// let uc = unsafe { m.assume_init() };
20572059
///
20582060
/// assert_eq!(uc.into_inner(), 5);

library/core/src/panic/panic_info.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ impl<'a> PanicInfo<'a> {
138138
/// whose ABI does not support unwinding.
139139
///
140140
/// It is safe for a panic handler to unwind even when this function returns
141-
/// true, however this will simply cause the panic handler to be called
141+
/// false, however this will simply cause the panic handler to be called
142142
/// again.
143143
#[must_use]
144144
#[unstable(feature = "panic_can_unwind", issue = "92988")]

0 commit comments

Comments
 (0)