Skip to content

Commit c25149b

Browse files
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.
2 parents df69809 + 0617156 commit c25149b

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)