Mark Once::new as #[inline].

Without this, it was not inlined in SyncOnceCell::into_inner(), causing
unecessary checks and dead code.
This commit is contained in:
Mara Bos 2020-09-12 17:11:47 +02:00
parent 8a261a2b34
commit aa68aaa8e1

View File

@ -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 {