mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 23:24:24 +00:00
Remove lint for ONCE_INIT
ONCE_INIT will be deprecated in rust 1.38.0
This commit is contained in:
parent
3a76bea04b
commit
481499101b
2 changed files with 1 additions and 10 deletions
|
@ -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()"),
|
||||
|
|
|
@ -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); };
|
||||
|
|
Loading…
Reference in a new issue