mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-09-21 07:01:54 +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] = [
|
const REPLACEMENTS: [([&str; 3], &str); 24] = [
|
||||||
// Once
|
|
||||||
(["core", "sync", "ONCE_INIT"], "Once::new()"),
|
|
||||||
// Min
|
// Min
|
||||||
(["core", "isize", "MIN"], "isize::min_value()"),
|
(["core", "isize", "MIN"], "isize::min_value()"),
|
||||||
(["core", "i8", "MIN"], "i8::min_value()"),
|
(["core", "i8", "MIN"], "i8::min_value()"),
|
||||||
|
|
|
@ -4,14 +4,9 @@
|
||||||
#![deny(clippy::replace_consts)]
|
#![deny(clippy::replace_consts)]
|
||||||
|
|
||||||
use std::sync::atomic::*;
|
use std::sync::atomic::*;
|
||||||
use std::sync::Once;
|
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
fn bad() {
|
fn bad() {
|
||||||
#[allow(deprecated, unused_imports)]
|
|
||||||
use std::sync::ONCE_INIT;
|
|
||||||
// Once
|
|
||||||
{ let foo = ONCE_INIT; };
|
|
||||||
// Min
|
// Min
|
||||||
{ let foo = std::isize::MIN; };
|
{ let foo = std::isize::MIN; };
|
||||||
{ let foo = std::i8::MIN; };
|
{ let foo = std::i8::MIN; };
|
||||||
|
@ -42,8 +37,6 @@ fn bad() {
|
||||||
|
|
||||||
#[rustfmt::skip]
|
#[rustfmt::skip]
|
||||||
fn good() {
|
fn good() {
|
||||||
// Once
|
|
||||||
{ let foo = Once::new(); };
|
|
||||||
// Atomic
|
// Atomic
|
||||||
{ let foo = AtomicBool::new(false); };
|
{ let foo = AtomicBool::new(false); };
|
||||||
{ let foo = AtomicIsize::new(0); };
|
{ let foo = AtomicIsize::new(0); };
|
||||||
|
|
Loading…
Reference in a new issue