Skip to content

Commit 1063548

Browse files
authored
Rollup merge of #108356 - gftea:master, r=workingjubilee
improve doc test for UnsafeCell::raw_get improve docs of public API `UnsafeCell::raw_get`
2 parents fc30207 + 1190c91 commit 1063548

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
@@ -2100,6 +2100,8 @@ impl<T: ?Sized> UnsafeCell<T> {
21002100
///
21012101
/// let m = MaybeUninit::<UnsafeCell<i32>>::uninit();
21022102
/// unsafe { UnsafeCell::raw_get(m.as_ptr()).write(5); }
2103+
/// // avoid below which references to uninitialized data
2104+
/// // unsafe { UnsafeCell::get(&*m.as_ptr()).write(5); }
21032105
/// let uc = unsafe { m.assume_init() };
21042106
///
21052107
/// assert_eq!(uc.into_inner(), 5);

library/core/src/panic/panic_info.rs

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

0 commit comments

Comments
 (0)