Skip to content

Commit

Permalink
Merge pull request #152 from Schaeff/allow-deprecated
Browse files Browse the repository at this point in the history
Allow deprecated to remove warnings in nightly
  • Loading branch information
KodrAus authored Jul 15, 2019
2 parents 65d58f1 + 1dbd5ae commit 8a5f404
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/inline_lazy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> with MaybeInitialized<T>
pub struct Lazy<T: Sync>(Cell<Option<T>>, Once);

impl<T: Sync> Lazy<T> {
#[allow(deprecated)]
pub const INIT: Self = Lazy(Cell::new(None), ONCE_INIT);

#[inline(always)]
Expand Down Expand Up @@ -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::<Void>() {}
}
2 changes: 2 additions & 0 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down

0 comments on commit 8a5f404

Please sign in to comment.