about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAngelicosPhosphoros <xuzin.timur@gmail.com>2021-12-20 22:59:03 +0300
committerAngelicosPhosphoros <xuzin.timur@gmail.com>2021-12-20 23:08:57 +0300
commit756d163741229c6ed35649cd2d0a58c6280bc29b (patch)
treeb685f08dda6e16c3163eed37dd9feb9c89ca7394
parent8f540619007c1aa62dfc915409d881f52f21dc84 (diff)
downloadrust-756d163741229c6ed35649cd2d0a58c6280bc29b.tar.gz
rust-756d163741229c6ed35649cd2d0a58c6280bc29b.zip
Add `#[inline]` modifier to `TypeId::of`
It was already inlined but it happened only in 4th InlinerPass on my testcase.
With `#[inline]` modifier it happens on 2nd pass.

Closes #74362
-rw-r--r--library/core/src/any.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/any.rs b/library/core/src/any.rs
index 72528185707..bc66fdbd0d8 100644
--- a/library/core/src/any.rs
+++ b/library/core/src/any.rs
@@ -616,6 +616,7 @@ impl TypeId {
     /// assert_eq!(is_string(&0), false);
     /// assert_eq!(is_string(&"cookie monster".to_string()), true);
     /// ```
+    #[inline]
     #[must_use]
     #[stable(feature = "rust1", since = "1.0.0")]
     #[rustc_const_unstable(feature = "const_type_id", issue = "77125")]