Skip to content

Commit

Permalink
Rollup merge of rust-lang#78491 - petertodd:2020-inline-from-nonzero,…
Browse files Browse the repository at this point in the history
… r=sfackler

Inline NonZeroN::from(n)

Currently this results in the generated assembly having a function call for this trivial conversion.
  • Loading branch information
JohnTitor committed Oct 29, 2020
2 parents ad10128 + 0617156 commit c779223
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/core/src/num/nonzero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit c779223

Please sign in to comment.