mirror of
https://github.com/rust-lang/log.git
synced 2026-02-14 20:08:22 +00:00
Merge pull request #321 from dekellum/ignore-atomic-init-depr
Silence deprecation warning for ATOMIC_USIZE_INIT
This commit is contained in:
commit
7d7daf6258
11
src/lib.rs
11
src/lib.rs
@ -295,7 +295,13 @@ use std::error;
|
||||
use std::fmt;
|
||||
use std::mem;
|
||||
use std::str::FromStr;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
|
||||
// FIXME: ATOMIC_USIZE_INIT was deprecated in rust 1.34. Silence the
|
||||
// deprecation warning until our MSRV >= 1.24, where we can use the
|
||||
// replacement const fn `AtomicUsize::new`
|
||||
#[allow(deprecated)]
|
||||
use std::sync::atomic::ATOMIC_USIZE_INIT;
|
||||
|
||||
#[macro_use]
|
||||
mod macros;
|
||||
@ -304,6 +310,8 @@ mod serde;
|
||||
// The LOGGER static holds a pointer to the global logger. It is protected by
|
||||
// the STATE static which determines whether LOGGER has been initialized yet.
|
||||
static mut LOGGER: &'static Log = &NopLogger;
|
||||
|
||||
#[allow(deprecated)]
|
||||
static STATE: AtomicUsize = ATOMIC_USIZE_INIT;
|
||||
|
||||
// There are three different states that we care about: the logger's
|
||||
@ -313,6 +321,7 @@ const UNINITIALIZED: usize = 0;
|
||||
const INITIALIZING: usize = 1;
|
||||
const INITIALIZED: usize = 2;
|
||||
|
||||
#[allow(deprecated)]
|
||||
static MAX_LOG_LEVEL_FILTER: AtomicUsize = ATOMIC_USIZE_INIT;
|
||||
|
||||
static LOG_LEVEL_NAMES: [&'static str; 6] = ["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user