allow deprecated to remove warning in nightly

This commit is contained in:
schaeff 2019-07-09 10:29:27 +02:00
parent 65d58f1a60
commit 1dbd5ae6cc
2 changed files with 5 additions and 0 deletions

View File

@ -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)]
@ -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>() {}
}

View File

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