mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Add #[inline] to trivial AsRef impls
These appeared uninlined in some perf runs, but they're trivial.
This commit is contained in:
parent
6cbc6c35e4
commit
4194d7537e
@ -486,6 +486,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)
|
||||
}
|
||||
@ -498,6 +499,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)
|
||||
}
|
||||
@ -518,6 +520,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…
Reference in New Issue
Block a user