mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +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
|
where
|
||||||
T: ~const AsRef<U>,
|
T: ~const AsRef<U>,
|
||||||
{
|
{
|
||||||
|
#[inline]
|
||||||
fn as_ref(&self) -> &U {
|
fn as_ref(&self) -> &U {
|
||||||
<T as AsRef<U>>::as_ref(*self)
|
<T as AsRef<U>>::as_ref(*self)
|
||||||
}
|
}
|
||||||
@ -498,6 +499,7 @@ impl<T: ?Sized, U: ?Sized> const AsRef<U> for &mut T
|
|||||||
where
|
where
|
||||||
T: ~const AsRef<U>,
|
T: ~const AsRef<U>,
|
||||||
{
|
{
|
||||||
|
#[inline]
|
||||||
fn as_ref(&self) -> &U {
|
fn as_ref(&self) -> &U {
|
||||||
<T as AsRef<U>>::as_ref(*self)
|
<T as AsRef<U>>::as_ref(*self)
|
||||||
}
|
}
|
||||||
@ -518,6 +520,7 @@ impl<T: ?Sized, U: ?Sized> const AsMut<U> for &mut T
|
|||||||
where
|
where
|
||||||
T: ~const AsMut<U>,
|
T: ~const AsMut<U>,
|
||||||
{
|
{
|
||||||
|
#[inline]
|
||||||
fn as_mut(&mut self) -> &mut U {
|
fn as_mut(&mut self) -> &mut U {
|
||||||
(*self).as_mut()
|
(*self).as_mut()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user