@@ -67,8 +67,10 @@ impl<T: ?Sized> *mut T {
6767 /// and cannot be created from one without additional context.
6868 ///
6969 /// If you would like to treat a pointer like an integer anyway,
70- /// see [`addr`][#method.addr-1] and [`with_addr`][#method.with_addr-1] for
71- /// the responsible way to do that.
70+ /// see [`addr`] and [`with_addr`] for the responsible way to do that.
71+ ///
72+ /// [`addr`]: pointer::addr
73+ /// [`with_addr`]: pointer::with_addr
7274 #[ unstable( feature = "ptr_to_from_bits" , issue = "91126" ) ]
7375 pub fn to_bits ( self ) -> [ u8 ; core:: mem:: size_of :: < * mut ( ) > ( ) ]
7476 where
@@ -110,8 +112,10 @@ impl<T: ?Sized> *mut T {
110112 /// and is equivalent to the deprecated `ptr as usize` cast.
111113 ///
112114 /// On more complicated platforms like CHERI and segmented architectures,
113- /// this may remove some important metadata. See [`with_addr`][#method.with_addr-1] for
115+ /// this may remove some important metadata. See [`with_addr`] for
114116 /// details on this distinction and why it's important.
117+ ///
118+ /// [`with_addr`]: pointer::with_addr
115119 #[ unstable( feature = "strict_provenance" , issue = "99999999" ) ]
116120 pub fn addr ( self ) -> usize
117121 where
@@ -154,6 +158,7 @@ impl<T: ?Sized> *mut T {
154158 /// with tagged pointers. Here we have a tag in the lowest bit:
155159 ///
156160 /// ```text
161+ /// #![feature(strict_provenance)]
157162 /// let my_tagged_ptr: *mut T = ...;
158163 ///
159164 /// // Get the address and do whatever bit tricks we like
@@ -352,7 +357,7 @@ impl<T: ?Sized> *mut T {
352357 /// enables more aggressive compiler optimizations.
353358 ///
354359 /// [`wrapping_offset`]: #method.wrapping_offset
355- /// [allocated object]: crate::ptr#allocated-object
360+ /// [allocated object]: crate::ptr#allocated-objects-and-provenance
356361 ///
357362 /// # Examples
358363 ///
@@ -440,7 +445,7 @@ impl<T: ?Sized> *mut T {
440445 /// platform-specific and not at all portable.
441446 ///
442447 /// [`offset`]: #method.offset
443- /// [allocated object]: crate::ptr#allocated-object
448+ /// [allocated object]: crate::ptr#allocated-objects-and-provenance
444449 ///
445450 /// # Examples
446451 ///
@@ -683,7 +688,7 @@ impl<T: ?Sized> *mut T {
683688 /// such large allocations either.)
684689 ///
685690 /// [`add`]: #method.add
686- /// [allocated object]: crate::ptr#allocated-object
691+ /// [allocated object]: crate::ptr#allocated-objects-and-provenance
687692 ///
688693 /// # Panics
689694 ///
@@ -708,6 +713,7 @@ impl<T: ?Sized> *mut T {
708713 /// *Incorrect* usage:
709714 ///
710715 /// ```rust,no_run
716+ /// #![feature(strict_provenance)]
711717 /// let ptr1 = Box::into_raw(Box::new(0u8));
712718 /// let ptr2 = Box::into_raw(Box::new(1u8));
713719 /// let diff = (ptr2.addr() as isize).wrapping_sub(ptr1.addr() as isize);
@@ -768,7 +774,7 @@ impl<T: ?Sized> *mut T {
768774 /// enables more aggressive compiler optimizations.
769775 ///
770776 /// [`wrapping_add`]: #method.wrapping_add
771- /// [allocated object]: crate::ptr#allocated-object
777+ /// [allocated object]: crate::ptr#allocated-objects-and-provenance
772778 ///
773779 /// # Examples
774780 ///
@@ -832,7 +838,7 @@ impl<T: ?Sized> *mut T {
832838 /// enables more aggressive compiler optimizations.
833839 ///
834840 /// [`wrapping_sub`]: #method.wrapping_sub
835- /// [allocated object]: crate::ptr#allocated-object
841+ /// [allocated object]: crate::ptr#allocated-objects-and-provenance
836842 ///
837843 /// # Examples
838844 ///
@@ -889,7 +895,7 @@ impl<T: ?Sized> *mut T {
889895 /// allocated object and then re-entering it later is permitted.
890896 ///
891897 /// [`add`]: #method.add
892- /// [allocated object]: crate::ptr#allocated-object
898+ /// [allocated object]: crate::ptr#allocated-objects-and-provenance
893899 ///
894900 /// # Examples
895901 ///
@@ -951,7 +957,7 @@ impl<T: ?Sized> *mut T {
951957 /// allocated object and then re-entering it later is permitted.
952958 ///
953959 /// [`sub`]: #method.sub
954- /// [allocated object]: crate::ptr#allocated-object
960+ /// [allocated object]: crate::ptr#allocated-objects-and-provenance
955961 ///
956962 /// # Examples
957963 ///
@@ -1456,7 +1462,7 @@ impl<T> *mut [T] {
14561462 /// See also [`slice::from_raw_parts`][].
14571463 ///
14581464 /// [valid]: crate::ptr#safety
1459- /// [allocated object]: crate::ptr#allocated-object
1465+ /// [allocated object]: crate::ptr#allocated-objects-and-provenance
14601466 #[ inline]
14611467 #[ unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
14621468 #[ rustc_const_unstable( feature = "const_ptr_as_ref" , issue = "91822" ) ]
@@ -1508,7 +1514,7 @@ impl<T> *mut [T] {
15081514 /// See also [`slice::from_raw_parts_mut`][].
15091515 ///
15101516 /// [valid]: crate::ptr#safety
1511- /// [allocated object]: crate::ptr#allocated-object
1517+ /// [allocated object]: crate::ptr#allocated-objects-and-provenance
15121518 #[ inline]
15131519 #[ unstable( feature = "ptr_as_uninit" , issue = "75402" ) ]
15141520 #[ rustc_const_unstable( feature = "const_ptr_as_ref" , issue = "91822" ) ]
0 commit comments