Skip to content

Commit 1dbd5ae

Browse files
committed
allow deprecated to remove warning in nightly
1 parent 65d58f1 commit 1dbd5ae

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/inline_lazy.rs

+3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ extern crate std;
1111
use self::std::prelude::v1::*;
1212
use self::std::cell::Cell;
1313
use self::std::sync::Once;
14+
#[allow(deprecated)]
1415
pub use self::std::sync::ONCE_INIT;
1516

1617
// FIXME: Replace Option<T> with MaybeInitialized<T>
1718
pub struct Lazy<T: Sync>(Cell<Option<T>>, Once);
1819

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

2224
#[inline(always)]
@@ -61,5 +63,6 @@ macro_rules! __lazy_static_create {
6163
/// This should be replaced by std's version when lazy_static starts to require at least Rust 1.27.
6264
unsafe fn unreachable_unchecked() -> ! {
6365
enum Void {}
66+
#[allow(deprecated)]
6467
match std::mem::uninitialized::<Void>() {}
6568
}

tests/test.rs

+2
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ fn item_name_shadowing() {
133133
}
134134

135135
use std::sync::atomic::AtomicBool;
136+
#[allow(deprecated)]
136137
use std::sync::atomic::ATOMIC_BOOL_INIT;
137138
use std::sync::atomic::Ordering::SeqCst;
138139

140+
#[allow(deprecated)]
139141
static PRE_INIT_FLAG: AtomicBool = ATOMIC_BOOL_INIT;
140142

141143
lazy_static! {

0 commit comments

Comments
 (0)