mirror of
https://gitee.com/openharmony/third_party_rust_lazy-static.rs
synced 2024-11-23 07:29:44 +00:00
Merge pull request #152 from Schaeff/allow-deprecated
Allow deprecated to remove warnings in nightly
This commit is contained in:
commit
8a5f404fc8
@ -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>() {}
|
||||
}
|
||||
|
@ -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! {
|
||||
|
Loading…
Reference in New Issue
Block a user