Make <*{const,mut} T>::{,wrapping_}sub methods #[inline(always)]

This commit is contained in:
Eduardo Sánchez Muñoz 2022-12-09 20:30:06 +01:00
parent f058493307
commit 3ed058bcbb
2 changed files with 4 additions and 4 deletions

View File

@ -1008,7 +1008,7 @@ pub const fn guaranteed_ne(self, other: *const T) -> Option<bool>
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
#[inline]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn sub(self, count: usize) -> Self
where
@ -1173,7 +1173,7 @@ pub const fn wrapping_byte_add(self, count: usize) -> Self {
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
#[inline]
#[inline(always)]
pub const fn wrapping_sub(self, count: usize) -> Self
where
T: Sized,

View File

@ -1110,7 +1110,7 @@ pub const fn guaranteed_ne(self, other: *mut T) -> Option<bool>
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
#[inline]
#[inline(always)]
#[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces
pub const unsafe fn sub(self, count: usize) -> Self
where
@ -1275,7 +1275,7 @@ pub const fn wrapping_byte_add(self, count: usize) -> Self {
#[stable(feature = "pointer_methods", since = "1.26.0")]
#[must_use = "returns a new pointer rather than modifying its argument"]
#[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")]
#[inline]
#[inline(always)]
pub const fn wrapping_sub(self, count: usize) -> Self
where
T: Sized,