diff options
Diffstat (limited to 'library/core/src/cell.rs')
-rw-r--r-- | library/core/src/cell.rs | 2 |
1 files changed, 2 insertions, 0 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); |