Skip to content

Commit

Permalink
Auto merge of #109546 - saethlin:inline-into, r=scottmcm
Browse files Browse the repository at this point in the history
Add #[inline] to the Into for From impl

I was skimming through the standard library MIR and I noticed a handful of very suspicious `Into::into` calls in `alloc`. ~Since this is a trivial wrapper function, `#[inline(always)]` seems appropriate.;~ `#[inline]` works too and is a lot less spooky.

r? `@thomcc`
  • Loading branch information
bors committed Mar 25, 2023
2 parents d012d2f + badfb17 commit 24a69af
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/convert/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ where
///
/// That is, this conversion is whatever the implementation of
/// <code>[From]&lt;T&gt; for U</code> chooses to do.
#[inline]
fn into(self) -> U {
U::from(self)
}
Expand Down

0 comments on commit 24a69af

Please sign in to comment.