@@ -45,7 +45,7 @@ impl<T: ?Sized> *const T {
4545 /// Casts to a pointer of another type.
4646 #[ stable( feature = "ptr_cast" , since = "1.38.0" ) ]
4747 #[ rustc_const_stable( feature = "const_ptr_cast" , since = "1.38.0" ) ]
48- #[ inline]
48+ #[ inline( always ) ]
4949 pub const fn cast < U > ( self ) -> * const U {
5050 self as _
5151 }
@@ -95,6 +95,7 @@ impl<T: ?Sized> *const T {
9595 /// refactored.
9696 #[ stable( feature = "ptr_const_cast" , since = "1.65.0" ) ]
9797 #[ rustc_const_stable( feature = "ptr_const_cast" , since = "1.65.0" ) ]
98+ #[ inline( always) ]
9899 pub const fn cast_mut ( self ) -> * mut T {
99100 self as _
100101 }
@@ -126,6 +127,7 @@ impl<T: ?Sized> *const T {
126127 note = "replaced by the `exposed_addr` method, or update your code \
127128 to follow the strict provenance rules using its APIs"
128129 ) ]
130+ #[ inline( always) ]
129131 pub fn to_bits ( self ) -> usize
130132 where
131133 T : Sized ,
@@ -155,6 +157,7 @@ impl<T: ?Sized> *const T {
155157 your code to follow the strict provenance rules using its APIs"
156158 ) ]
157159 #[ allow( fuzzy_provenance_casts) ] // this is an unstable and semi-deprecated cast function
160+ #[ inline( always) ]
158161 pub fn from_bits ( bits : usize ) -> Self
159162 where
160163 T : Sized ,
@@ -186,7 +189,7 @@ impl<T: ?Sized> *const T {
186189 /// might change in the future (including possibly weakening this so it becomes wholly
187190 /// equivalent to `self as usize`). See the [module documentation][crate::ptr] for details.
188191 #[ must_use]
189- #[ inline]
192+ #[ inline( always ) ]
190193 #[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
191194 pub fn addr ( self ) -> usize
192195 where
@@ -223,7 +226,7 @@ impl<T: ?Sized> *const T {
223226 ///
224227 /// [`from_exposed_addr`]: from_exposed_addr
225228 #[ must_use]
226- #[ inline]
229+ #[ inline( always ) ]
227230 #[ unstable( feature = "strict_provenance" , issue = "95228" ) ]
228231 pub fn expose_addr ( self ) -> usize
229232 where
0 commit comments