We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4a4734 commit 835f860Copy full SHA for 835f860
text/0000-uninitialized-uninhabited.md
@@ -202,13 +202,13 @@ impl<T> MaybeUninit<T> {
202
/// Get a pointer to the contained value. This pointer will only be valid if the `MaybeUninit`
203
/// is in an initialized state.
204
pub fn as_ptr(&self) -> *const T {
205
- unsafe { &self.value as *const T }
+ self as *const MaybeUninit<T> as *const T
206
}
207
208
/// Get a mutable pointer to the contained value. This pointer will only be valid if the
209
/// `MaybeUninit` is in an initialized state.
210
pub fn as_mut_ptr(&mut self) -> *mut T {
211
- unsafe { &mut self.value as *mut T }
+ self as *mut MaybeUninit<T> as *mut T
212
213
214
```
0 commit comments