Merge pull request #152 from Schaeff/allow-deprecated

Allow deprecated to remove warnings in nightly
This commit is contained in:
Ashley Mannix 2019-07-16 09:11:53 +10:00 committed by GitHub
commit 8a5f404fc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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! {