@@ -296,24 +296,7 @@ impl<T: ?Sized> *mut T {
296296 ///
297297 /// # Safety
298298 ///
299- /// When calling this method, you have to ensure that all of the following is true:
300- ///
301- /// * The pointer must be properly aligned.
302- ///
303- /// * It must be "dereferenceable" in the sense defined in [the module documentation].
304- ///
305- /// * The pointer must point to an initialized instance of `T`.
306- ///
307- /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
308- /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
309- /// In particular, while this reference exists, the memory the pointer points to must
310- /// not get mutated (except inside `UnsafeCell`).
311- ///
312- /// This applies even if the result of this method is unused!
313- /// (The part about being initialized is not yet fully decided, but until
314- /// it is, the only safe approach is to ensure that they are indeed initialized.)
315- ///
316- /// [the module documentation]: crate::ptr#safety
299+ /// When calling this method, you have to ensure that the pointer is [convirtible to a reference](crate::ptr#pointer-to-reference-conversion)
317300 ///
318301 /// # Examples
319302 ///
@@ -347,20 +330,9 @@ impl<T: ?Sized> *mut T {
347330 /// # Safety
348331 ///
349332 /// When calling this method, you have to ensure that *either* the pointer is null *or*
350- /// all of the following is true:
351- ///
352- /// * The pointer must be properly aligned.
353- ///
354- /// * It must be "dereferenceable" in the sense defined in [the module documentation].
355- ///
356- /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
357- /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
358- /// In particular, while this reference exists, the memory the pointer points to must
359- /// not get mutated (except inside `UnsafeCell`).
360- ///
361- /// This applies even if the result of this method is unused!
362- ///
363- /// [the module documentation]: crate::ptr#safety
333+ /// the pointer is [convirtible to a reference](crate::ptr#pointer-to-reference-conversion).
334+ /// Note that because the created reference is to `MaybeUninit<T>`, the
335+ /// source pointer can point to uninitialized memory.
364336 ///
365337 /// # Examples
366338 ///
@@ -594,7 +566,7 @@ impl<T: ?Sized> *mut T {
594566 ///
595567 /// When calling this method, you have to ensure that *either*
596568 /// the pointer is null *or*
597- /// the pointer is [convirtible to a reference](crate::ptr#pointer-to-reference-conversion)
569+ /// the pointer is [convertible to a reference](crate::ptr#pointer-to-reference-conversion)
598570 ///
599571 ///
600572 /// # Examples
@@ -643,24 +615,8 @@ impl<T: ?Sized> *mut T {
643615 ///
644616 /// # Safety
645617 ///
646- /// When calling this method, you have to ensure that all of the following is true:
647- ///
648- /// * The pointer must be properly aligned.
649- ///
650- /// * It must be "dereferenceable" in the sense defined in [the module documentation].
651- ///
652- /// * The pointer must point to an initialized instance of `T`.
653- ///
654- /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
655- /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
656- /// In particular, while this reference exists, the memory the pointer points to must
657- /// not get mutated (except inside `UnsafeCell`).
658- ///
659- /// This applies even if the result of this method is unused!
660- /// (The part about being initialized is not yet fully decided, but until
661- /// it is, the only safe approach is to ensure that they are indeed initialized.)
662- ///
663- /// [the module documentation]: crate::ptr#safety
618+ /// When calling this method, you have to ensure that
619+ /// the pointer is [convertible to a reference](crate::ptr#pointer-to-reference-conversion)
664620 ///
665621 /// # Examples
666622 ///
@@ -695,20 +651,7 @@ impl<T: ?Sized> *mut T {
695651 /// # Safety
696652 ///
697653 /// When calling this method, you have to ensure that *either* the pointer is null *or*
698- /// all of the following is true:
699- ///
700- /// * The pointer must be properly aligned.
701- ///
702- /// * It must be "dereferenceable" in the sense defined in [the module documentation].
703- ///
704- /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
705- /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
706- /// In particular, while this reference exists, the memory the pointer points to must
707- /// not get accessed (read or written) through any other pointer.
708- ///
709- /// This applies even if the result of this method is unused!
710- ///
711- /// [the module documentation]: crate::ptr#safety
654+ /// the pointer is [convertible to a reference](crate::ptr#pointer-to-reference-conversion)
712655 #[ inline]
713656 #[ unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
714657 #[ rustc_const_unstable( feature = "const_ptr_as_ref" , issue = "91822" ) ]
0 commit comments