diff --git a/src/inline_lazy.rs b/src/inline_lazy.rs index 268dd45..6ffdc44 100644 --- a/src/inline_lazy.rs +++ b/src/inline_lazy.rs @@ -11,12 +11,14 @@ extern crate std; use self::std::prelude::v1::*; use self::std::cell::Cell; use self::std::sync::Once; +#[allow(deprecated)] pub use self::std::sync::ONCE_INIT; // FIXME: Replace Option with MaybeInitialized pub struct Lazy(Cell>, Once); impl Lazy { + #[allow(deprecated)] pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT); #[inline(always)] @@ -61,5 +63,6 @@ macro_rules! __lazy_static_create { /// This should be replaced by std's version when lazy_static starts to require at least Rust 1.27. unsafe fn unreachable_unchecked() -> ! { enum Void {} + #[allow(deprecated)] match std::mem::uninitialized::() {} } diff --git a/tests/test.rs b/tests/test.rs index 654abc5..03d0ab6 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -133,9 +133,11 @@ fn item_name_shadowing() { } use std::sync::atomic::AtomicBool; +#[allow(deprecated)] use std::sync::atomic::ATOMIC_BOOL_INIT; use std::sync::atomic::Ordering::SeqCst; +#[allow(deprecated)] static PRE_INIT_FLAG: AtomicBool = ATOMIC_BOOL_INIT; lazy_static! {