From 481499101b96f4a8253501fb8fbc03d64e9b83b5 Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Sat, 6 Jul 2019 12:30:11 +0700 Subject: [PATCH] Remove lint for ONCE_INIT ONCE_INIT will be deprecated in rust 1.38.0 --- clippy_lints/src/replace_consts.rs | 4 +--- tests/ui/replace_consts.rs | 7 ------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/clippy_lints/src/replace_consts.rs b/clippy_lints/src/replace_consts.rs index c15eca15c..cb7be85ab 100644 --- a/clippy_lints/src/replace_consts.rs +++ b/clippy_lints/src/replace_consts.rs @@ -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()"), diff --git a/tests/ui/replace_consts.rs b/tests/ui/replace_consts.rs index 18e9ac9f1..0c8440e76 100644 --- a/tests/ui/replace_consts.rs +++ b/tests/ui/replace_consts.rs @@ -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); };