diff --git a/src/layout.rs b/src/layout.rs index 5aaf102f8a..e73fef409b 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -451,6 +451,7 @@ impl DstLayout { /// rely on `validate_cast_and_convert_metadata` panicking in any particular /// condition, even if `debug_assertions` are enabled. #[allow(unused)] + #[inline(always)] pub(crate) const fn validate_cast_and_convert_metadata( &self, addr: usize, diff --git a/src/pointer/ptr.rs b/src/pointer/ptr.rs index b476d1428f..c134139032 100644 --- a/src/pointer/ptr.rs +++ b/src/pointer/ptr.rs @@ -906,6 +906,7 @@ mod _casts { /// - If this is a prefix cast, `ptr` has the same address as `self`. /// - If this is a suffix cast, `remainder` has the same address as /// `self`. + #[inline(always)] pub(crate) fn try_cast_into( self, cast_type: CastType,