Skip to content

Commit 4814991

Browse files
committed
Remove lint for ONCE_INIT
ONCE_INIT will be deprecated in rust 1.38.0
1 parent 3a76bea commit 4814991

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

clippy_lints/src/replace_consts.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ReplaceConsts {
5656
}
5757
}
5858

59-
const REPLACEMENTS: [([&str; 3], &str); 25] = [
60-
// Once
61-
(["core", "sync", "ONCE_INIT"], "Once::new()"),
59+
const REPLACEMENTS: [([&str; 3], &str); 24] = [
6260
// Min
6361
(["core", "isize", "MIN"], "isize::min_value()"),
6462
(["core", "i8", "MIN"], "i8::min_value()"),

tests/ui/replace_consts.rs

-7
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,9 @@
44
#![deny(clippy::replace_consts)]
55

66
use std::sync::atomic::*;
7-
use std::sync::Once;
87

98
#[rustfmt::skip]
109
fn bad() {
11-
#[allow(deprecated, unused_imports)]
12-
use std::sync::ONCE_INIT;
13-
// Once
14-
{ let foo = ONCE_INIT; };
1510
// Min
1611
{ let foo = std::isize::MIN; };
1712
{ let foo = std::i8::MIN; };
@@ -42,8 +37,6 @@ fn bad() {
4237

4338
#[rustfmt::skip]
4439
fn good() {
45-
// Once
46-
{ let foo = Once::new(); };
4740
// Atomic
4841
{ let foo = AtomicBool::new(false); };
4942
{ let foo = AtomicIsize::new(0); };

0 commit comments

Comments
 (0)