Skip to content

Commit c779223

Browse files
authored
Rollup merge of rust-lang#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.
2 parents ad10128 + 0617156 commit c779223

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/core/src/num/nonzero.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
9292
doc_comment! {
9393
concat!(
9494
"Converts a `", stringify!($Ty), "` into an `", stringify!($Int), "`"),
95+
#[inline]
9596
fn from(nonzero: $Ty) -> Self {
9697
nonzero.0
9798
}

0 commit comments

Comments
 (0)