Auto merge of #94372 - erikdesjardins:asrefinl, r=dtolnay
Add #[inline] to trivial AsRef/AsMut impls These appeared uninlined in some perf runs, but they're trivial. r? `@ghost`
This commit is contained in:
commit
f2661cfe34
1 changed files with 3 additions and 0 deletions
|
@ -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)
|
||||
}
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue