diff options
| author | Yuki Okushi <huyuumi.dev@gmail.com> | 2020-10-29 12:08:59 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-29 12:08:59 +0900 |
| commit | c7792230c073410fad646dd09e1de3c3d29ef250 (patch) | |
| tree | db757c3abffe5faf2d800b363d75cff17420fb09 | |
| parent | ad1012834cc625e1c6695b62a1d4c58e9995c8d2 (diff) | |
| parent | 061715604aa1374a087c25721133ef2d18f5091f (diff) | |
| download | rust-c7792230c073410fad646dd09e1de3c3d29ef250.tar.gz rust-c7792230c073410fad646dd09e1de3c3d29ef250.zip | |
Rollup merge of #78491 - petertodd:2020-inline-from-nonzero, r=sfackler
Inline NonZeroN::from(n) Currently this results in the generated assembly having a function call for this trivial conversion.
| -rw-r--r-- | library/core/src/num/nonzero.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/library/core/src/num/nonzero.rs b/library/core/src/num/nonzero.rs index 382f799bfe5..5a9fd902c9c 100644 --- a/library/core/src/num/nonzero.rs +++ b/library/core/src/num/nonzero.rs @@ -92,6 +92,7 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s doc_comment! { concat!( "Converts a `", stringify!($Ty), "` into an `", stringify!($Int), "`"), + #[inline] fn from(nonzero: $Ty) -> Self { nonzero.0 } |
