Skip to content

Add #[inline] to trivial AsRef/AsMut impls #94372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand All @@ -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()
}
Expand Down