Skip to content

Commit 1a65fcf

Browse files
Add #[inline] to trivial AsRef impls
These appeared uninlined in some perf runs, but they're trivial.
1 parent c63c7ba commit 1a65fcf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/convert/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ impl<T: ?Sized, U: ?Sized> const AsRef<U> for &T
486486
where
487487
T: ~const AsRef<U>,
488488
{
489+
#[inline]
489490
fn as_ref(&self) -> &U {
490491
<T as AsRef<U>>::as_ref(*self)
491492
}
@@ -498,6 +499,7 @@ impl<T: ?Sized, U: ?Sized> const AsRef<U> for &mut T
498499
where
499500
T: ~const AsRef<U>,
500501
{
502+
#[inline]
501503
fn as_ref(&self) -> &U {
502504
<T as AsRef<U>>::as_ref(*self)
503505
}
@@ -518,6 +520,7 @@ impl<T: ?Sized, U: ?Sized> const AsMut<U> for &mut T
518520
where
519521
T: ~const AsMut<U>,
520522
{
523+
#[inline]
521524
fn as_mut(&mut self) -> &mut U {
522525
(*self).as_mut()
523526
}

0 commit comments

Comments
 (0)