Remove lint for ONCE_INIT

ONCE_INIT will be deprecated in rust 1.38.0
This commit is contained in:
Lzu Tao 2019-07-06 12:30:11 +07:00
parent 3a76bea04b
commit 481499101b
2 changed files with 1 additions and 10 deletions

View file

@ -56,9 +56,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ReplaceConsts {
}
}
const REPLACEMENTS: [([&str; 3], &str); 25] = [
// Once
(["core", "sync", "ONCE_INIT"], "Once::new()"),
const REPLACEMENTS: [([&str; 3], &str); 24] = [
// Min
(["core", "isize", "MIN"], "isize::min_value()"),
(["core", "i8", "MIN"], "i8::min_value()"),

View file

@ -4,14 +4,9 @@
#![deny(clippy::replace_consts)]
use std::sync::atomic::*;
use std::sync::Once;
#[rustfmt::skip]
fn bad() {
#[allow(deprecated, unused_imports)]
use std::sync::ONCE_INIT;
// Once
{ let foo = ONCE_INIT; };
// Min
{ let foo = std::isize::MIN; };
{ let foo = std::i8::MIN; };
@ -42,8 +37,6 @@ fn bad() {
#[rustfmt::skip]
fn good() {
// Once
{ let foo = Once::new(); };
// Atomic
{ let foo = AtomicBool::new(false); };
{ let foo = AtomicIsize::new(0); };