Merge pull request #321 from dekellum/ignore-atomic-init-depr

Silence deprecation warning for ATOMIC_USIZE_INIT
This commit is contained in:
Ashley Mannix 2019-02-04 07:02:40 +10:00 committed by GitHub
commit 7d7daf6258
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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"];