about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-03-25 03:09:09 +0000
committerbors <bors@rust-lang.org>2023-03-25 03:09:09 +0000
commit24a69af213f4bf23014dc91903e7a934c88f6b9e (patch)
tree59d8a907b9117df1a18b48bac66bc52f40143d65
parentd012d2f96e2959267b14812929b85e17a155f653 (diff)
parentbadfb17d2fc9ff79a6064058c58dcea7526457f4 (diff)
downloadrust-24a69af213f4bf23014dc91903e7a934c88f6b9e.tar.gz
rust-24a69af213f4bf23014dc91903e7a934c88f6b9e.zip
Auto merge of #109546 - saethlin:inline-into, r=scottmcm
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`
-rw-r--r--library/core/src/convert/mod.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs
index 805354be089..8a8d4caf96f 100644
--- a/library/core/src/convert/mod.rs
+++ b/library/core/src/convert/mod.rs
@@ -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)
     }