Skip to content

Commit 67b4614

Browse files
committed
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.
1 parent da14081 commit 67b4614

File tree

1 file changed

+2
-0
lines changed
  • library/core/src/convert

1 file changed

+2
-0
lines changed

library/core/src/convert/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,7 @@ where
764764
{
765765
type Error = U::Error;
766766

767+
#[inline]
767768
fn try_into(self) -> Result<U, U::Error> {
768769
U::try_from(self)
769770
}
@@ -779,6 +780,7 @@ where
779780
{
780781
type Error = Infallible;
781782

783+
#[inline]
782784
fn try_from(value: U) -> Result<Self, Self::Error> {
783785
Ok(U::into(value))
784786
}

0 commit comments

Comments
 (0)