From 756d163741229c6ed35649cd2d0a58c6280bc29b Mon Sep 17 00:00:00 2001 From: AngelicosPhosphoros Date: Mon, 20 Dec 2021 22:59:03 +0300 Subject: [PATCH] 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 --- library/core/src/any.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/any.rs b/library/core/src/any.rs index 72528185707a6..bc66fdbd0d882 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")]