Skip to content

Commit aa68aaa

Browse files
committed
Mark Once::new as #[inline].
Without this, it was not inlined in SyncOnceCell::into_inner(), causing unecessary checks and dead code.
1 parent 8a261a2 commit aa68aaa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/std/src/sync/once.rs

+1
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ struct WaiterQueue<'a> {
191191

192192
impl Once {
193193
/// Creates a new `Once` value.
194+
#[inline]
194195
#[stable(feature = "once_new", since = "1.2.0")]
195196
#[rustc_const_stable(feature = "const_once_new", since = "1.32.0")]
196197
pub const fn new() -> Once {

0 commit comments

Comments
 (0)