Skip to content

Commit

Permalink
Remove lint for ONCE_INIT
Browse files Browse the repository at this point in the history
ONCE_INIT will be deprecated in rust 1.38.0
  • Loading branch information
tesuji committed Jul 6, 2019
1 parent 3a76bea commit 4814991
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
4 changes: 1 addition & 3 deletions clippy_lints/src/replace_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()"),
Expand Down
7 changes: 0 additions & 7 deletions tests/ui/replace_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
Expand Down Expand Up @@ -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); };
Expand Down

0 comments on commit 4814991

Please sign in to comment.