summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorgftea <ckq614@gmail.com>2023-02-22 19:18:19 +0100
committergftea <ckq614@gmail.com>2023-03-10 20:06:18 +0100
commit1190c91a61b056fcdebebd0770745f2a5649c71f (patch)
tree4ad030c1e30b497863623c14bb3c64255a554cde /library
parentd5833423a02e2373c5e3cceb238fb19192cd82f8 (diff)
downloadrust-1190c91a61b056fcdebebd0770745f2a5649c71f.tar.gz
improve doc test for UnsafeCell::raw_get and fix docs error
Diffstat (limited to 'library')
-rw-r--r--library/core/src/cell.rs2
-rw-r--r--library/core/src/panic/panic_info.rs2
2 files changed, 3 insertions, 1 deletions
diff --git a/library/core/src/cell.rs b/library/core/src/cell.rs
index 897d03595d7..8c7cd42d010 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -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); }
/// let uc = unsafe { m.assume_init() };
///
/// assert_eq!(uc.into_inner(), 5);
diff --git a/library/core/src/panic/panic_info.rs b/library/core/src/panic/panic_info.rs
index 0d385c9d187..28648f1360a 100644
--- a/library/core/src/panic/panic_info.rs
+++ b/library/core/src/panic/panic_info.rs
@@ -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")]