Skip to content

Commit

Permalink
Auto merge of #94372 - erikdesjardins:asrefinl, r=dtolnay
Browse files Browse the repository at this point in the history
Add #[inline] to trivial AsRef/AsMut impls

These appeared uninlined in some perf runs, but they're trivial.

r? `@ghost`
  • Loading branch information
bors committed Mar 19, 2022
2 parents 8d60bf4 + 4194d75 commit f2661cf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ impl<T: ?Sized, U: ?Sized> const AsRef<U> for &T
where
T: ~const AsRef<U>,
{
#[inline]
fn as_ref(&self) -> &U {
<T as AsRef<U>>::as_ref(*self)
}
Expand All @@ -499,6 +500,7 @@ impl<T: ?Sized, U: ?Sized> const AsRef<U> for &mut T
where
T: ~const AsRef<U>,
{
#[inline]
fn as_ref(&self) -> &U {
<T as AsRef<U>>::as_ref(*self)
}
Expand All @@ -519,6 +521,7 @@ impl<T: ?Sized, U: ?Sized> const AsMut<U> for &mut T
where
T: ~const AsMut<U>,
{
#[inline]
fn as_mut(&mut self) -> &mut U {
(*self).as_mut()
}
Expand Down

0 comments on commit f2661cf

Please sign in to comment.