mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-07 17:18:32 +03:00
expand as_[mut_]ptr docs a bit
This commit is contained in:
+4
-4
@@ -1174,16 +1174,16 @@ pub unsafe fn get_mut(&mut self) -> &mut T {
|
||||
&mut *self.value
|
||||
}
|
||||
|
||||
/// Get a pointer to the contained value. Reading from this pointer will be undefined
|
||||
/// behavior unless the `MaybeUninit` is initialized.
|
||||
/// Get a pointer to the contained value. Reading from this pointer or turning it
|
||||
/// into a reference will be undefined behavior unless the `MaybeUninit` is initialized.
|
||||
#[unstable(feature = "maybe_uninit", issue = "53491")]
|
||||
#[inline(always)]
|
||||
pub fn as_ptr(&self) -> *const T {
|
||||
unsafe { &*self.value as *const T }
|
||||
}
|
||||
|
||||
/// Get a mutable pointer to the contained value. Reading from this pointer will be undefined
|
||||
/// behavior unless the `MaybeUninit` is initialized.
|
||||
/// Get a mutable pointer to the contained value. Reading from this pointer or turning it
|
||||
/// into a reference will be undefined behavior unless the `MaybeUninit` is initialized.
|
||||
#[unstable(feature = "maybe_uninit", issue = "53491")]
|
||||
#[inline(always)]
|
||||
pub fn as_mut_ptr(&mut self) -> *mut T {
|
||||
|
||||
Reference in New Issue
Block a user