From 67b46141804132919a7976b3484cbcf6055e431e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Wed, 5 Apr 2023 00:00:00 +0000 Subject: [PATCH] Inline try_from and try_into To avoid link time dependency between core and compiler-builtins, when using opt-level that implicitly enables -Zshare-generics. While compiler-builtins should be compiled with -Zshare-generics disabled, the -Zbuild-std does not ensure this at the moment. --- library/core/src/convert/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/src/convert/mod.rs b/library/core/src/convert/mod.rs index 8a8d4caf96f..5888e2960bb 100644 --- a/library/core/src/convert/mod.rs +++ b/library/core/src/convert/mod.rs @@ -764,6 +764,7 @@ where { type Error = U::Error; + #[inline] fn try_into(self) -> Result { U::try_from(self) } @@ -779,6 +780,7 @@ where { type Error = Infallible; + #[inline] fn try_from(value: U) -> Result { Ok(U::into(value)) }