diff --git a/library/alloc/src/vec/mod.rs b/library/alloc/src/vec/mod.rs index cbb5b0627b77d..4c164952bde48 100644 --- a/library/alloc/src/vec/mod.rs +++ b/library/alloc/src/vec/mod.rs @@ -2491,6 +2491,7 @@ impl ExtendFromWithinSpec for Vec { impl ops::Deref for Vec { type Target = [T]; + #[inline(always)] fn deref(&self) -> &[T] { unsafe { slice::from_raw_parts(self.as_ptr(), self.len) } } @@ -2498,6 +2499,7 @@ impl ops::Deref for Vec { #[stable(feature = "rust1", since = "1.0.0")] impl ops::DerefMut for Vec { + #[inline(always)] fn deref_mut(&mut self) -> &mut [T] { unsafe { slice::from_raw_parts_mut(self.as_mut_ptr(), self.len) } } @@ -2914,6 +2916,7 @@ impl AsMut> for Vec { #[stable(feature = "rust1", since = "1.0.0")] impl AsRef<[T]> for Vec { + #[inline(always)] fn as_ref(&self) -> &[T] { self } @@ -2921,6 +2924,7 @@ impl AsRef<[T]> for Vec { #[stable(feature = "vec_as_mut", since = "1.5.0")] impl AsMut<[T]> for Vec { + #[inline(always)] fn as_mut(&mut self) -> &mut [T] { self } diff --git a/library/core/src/any.rs b/library/core/src/any.rs index 3b15ab1e6895b..f2a56334064d8 100644 --- a/library/core/src/any.rs +++ b/library/core/src/any.rs @@ -619,6 +619,7 @@ impl TypeId { #[must_use] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_const_unstable(feature = "const_type_id", issue = "77125")] + #[inline(always)] pub const fn of() -> TypeId { TypeId { t: intrinsics::type_id::() } }