about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-05-15 17:12:44 +0200
committerGitHub <noreply@github.com>2023-05-15 17:12:44 +0200
commit1063548a1a2ff954087eeeb8b6598c28cafa1e22 (patch)
tree96ca36881dd70d498fc11fd20104d14046b0303c
parentfc30207b1662a7159498bd3f476604e360809670 (diff)
parent1190c91a61b056fcdebebd0770745f2a5649c71f (diff)
downloadrust-1063548a1a2ff954087eeeb8b6598c28cafa1e22.tar.gz
rust-1063548a1a2ff954087eeeb8b6598c28cafa1e22.zip
Rollup merge of #108356 - gftea:master, r=workingjubilee
improve doc test for UnsafeCell::raw_get

improve docs of public API `UnsafeCell::raw_get`
-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 a96dfafd9c4..2c3c14853a4 100644
--- a/library/core/src/cell.rs
+++ b/library/core/src/cell.rs
@@ -2100,6 +2100,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 06fbe083ca1..5576adde84b 100644
--- a/library/core/src/panic/panic_info.rs
+++ b/library/core/src/panic/panic_info.rs
@@ -134,7 +134,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")]