From 4194d7537ecd689e7f920292af33a4fbe1346b61 Mon Sep 17 00:00:00 2001 From: Erik Desjardins Date: Fri, 25 Feb 2022 15:18:16 -0500 Subject: [PATCH] Add #[inline] to trivial AsRef impls These appeared uninlined in some perf runs, but they're trivial. --- library/core/src/convert/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 0ceedf936333d..c1ee0a66c5693 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -486,6 +486,7 @@ impl const AsRef for &T where T: ~const AsRef, { + #[inline] fn as_ref(&self) -> &U { >::as_ref(*self) } @@ -498,6 +499,7 @@ impl const AsRef for &mut T where T: ~const AsRef, { + #[inline] fn as_ref(&self) -> &U { >::as_ref(*self) } @@ -518,6 +520,7 @@ impl const AsMut for &mut T where T: ~const AsMut, { + #[inline] fn as_mut(&mut self) -> &mut U { (*self).as_mut() }