Skip to content

Commit

Permalink
Mark Once::new as #[inline].
Browse files Browse the repository at this point in the history
Without this, it was not inlined in SyncOnceCell::into_inner(), causing
unecessary checks and dead code.
  • Loading branch information
m-ou-se committed Sep 12, 2020
1 parent 8a261a2 commit aa68aaa
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/std/src/sync/once.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ struct WaiterQueue<'a> {

impl Once {
/// Creates a new `Once` value.
#[inline]
#[stable(feature = "once_new", since = "1.2.0")]
#[rustc_const_stable(feature = "const_once_new", since = "1.32.0")]
pub const fn new() -> Once {
Expand Down

0 comments on commit aa68aaa

Please sign in to comment.