Skip to content

Commit 3a76bea

Browse files
committed
Update rustfix tests
1 parent 7293def commit 3a76bea

File tree

3 files changed

+27
-30
lines changed

3 files changed

+27
-30
lines changed

tests/ui/replace_consts.fixed

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

66
use std::sync::atomic::*;
7-
use std::sync::{Once, ONCE_INIT};
87

98
#[rustfmt::skip]
109
fn bad() {
11-
// Once
12-
{ let foo = ONCE_INIT; };
1310
// Min
1411
{ let foo = isize::min_value(); };
1512
{ let foo = i8::min_value(); };
@@ -40,8 +37,6 @@ fn bad() {
4037

4138
#[rustfmt::skip]
4239
fn good() {
43-
// Once
44-
{ let foo = Once::new(); };
4540
// Atomic
4641
{ let foo = AtomicBool::new(false); };
4742
{ let foo = AtomicIsize::new(0); };

tests/ui/replace_consts.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
#![deny(clippy::replace_consts)]
55

66
use std::sync::atomic::*;
7-
use std::sync::{Once, ONCE_INIT};
7+
use std::sync::Once;
88

99
#[rustfmt::skip]
1010
fn bad() {
11+
#[allow(deprecated, unused_imports)]
12+
use std::sync::ONCE_INIT;
1113
// Once
1214
{ let foo = ONCE_INIT; };
1315
// Min

tests/ui/replace_consts.stderr

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: using `MIN`
2-
--> $DIR/replace_consts.rs:14:17
2+
--> $DIR/replace_consts.rs:11:17
33
|
44
LL | { let foo = std::isize::MIN; };
55
| ^^^^^^^^^^^^^^^ help: try this: `isize::min_value()`
@@ -11,139 +11,139 @@ LL | #![deny(clippy::replace_consts)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^
1212

1313
error: using `MIN`
14-
--> $DIR/replace_consts.rs:15:17
14+
--> $DIR/replace_consts.rs:12:17
1515
|
1616
LL | { let foo = std::i8::MIN; };
1717
| ^^^^^^^^^^^^ help: try this: `i8::min_value()`
1818

1919
error: using `MIN`
20-
--> $DIR/replace_consts.rs:16:17
20+
--> $DIR/replace_consts.rs:13:17
2121
|
2222
LL | { let foo = std::i16::MIN; };
2323
| ^^^^^^^^^^^^^ help: try this: `i16::min_value()`
2424

2525
error: using `MIN`
26-
--> $DIR/replace_consts.rs:17:17
26+
--> $DIR/replace_consts.rs:14:17
2727
|
2828
LL | { let foo = std::i32::MIN; };
2929
| ^^^^^^^^^^^^^ help: try this: `i32::min_value()`
3030

3131
error: using `MIN`
32-
--> $DIR/replace_consts.rs:18:17
32+
--> $DIR/replace_consts.rs:15:17
3333
|
3434
LL | { let foo = std::i64::MIN; };
3535
| ^^^^^^^^^^^^^ help: try this: `i64::min_value()`
3636

3737
error: using `MIN`
38-
--> $DIR/replace_consts.rs:19:17
38+
--> $DIR/replace_consts.rs:16:17
3939
|
4040
LL | { let foo = std::i128::MIN; };
4141
| ^^^^^^^^^^^^^^ help: try this: `i128::min_value()`
4242

4343
error: using `MIN`
44-
--> $DIR/replace_consts.rs:20:17
44+
--> $DIR/replace_consts.rs:17:17
4545
|
4646
LL | { let foo = std::usize::MIN; };
4747
| ^^^^^^^^^^^^^^^ help: try this: `usize::min_value()`
4848

4949
error: using `MIN`
50-
--> $DIR/replace_consts.rs:21:17
50+
--> $DIR/replace_consts.rs:18:17
5151
|
5252
LL | { let foo = std::u8::MIN; };
5353
| ^^^^^^^^^^^^ help: try this: `u8::min_value()`
5454

5555
error: using `MIN`
56-
--> $DIR/replace_consts.rs:22:17
56+
--> $DIR/replace_consts.rs:19:17
5757
|
5858
LL | { let foo = std::u16::MIN; };
5959
| ^^^^^^^^^^^^^ help: try this: `u16::min_value()`
6060

6161
error: using `MIN`
62-
--> $DIR/replace_consts.rs:23:17
62+
--> $DIR/replace_consts.rs:20:17
6363
|
6464
LL | { let foo = std::u32::MIN; };
6565
| ^^^^^^^^^^^^^ help: try this: `u32::min_value()`
6666

6767
error: using `MIN`
68-
--> $DIR/replace_consts.rs:24:17
68+
--> $DIR/replace_consts.rs:21:17
6969
|
7070
LL | { let foo = std::u64::MIN; };
7171
| ^^^^^^^^^^^^^ help: try this: `u64::min_value()`
7272

7373
error: using `MIN`
74-
--> $DIR/replace_consts.rs:25:17
74+
--> $DIR/replace_consts.rs:22:17
7575
|
7676
LL | { let foo = std::u128::MIN; };
7777
| ^^^^^^^^^^^^^^ help: try this: `u128::min_value()`
7878

7979
error: using `MAX`
80-
--> $DIR/replace_consts.rs:27:17
80+
--> $DIR/replace_consts.rs:24:17
8181
|
8282
LL | { let foo = std::isize::MAX; };
8383
| ^^^^^^^^^^^^^^^ help: try this: `isize::max_value()`
8484

8585
error: using `MAX`
86-
--> $DIR/replace_consts.rs:28:17
86+
--> $DIR/replace_consts.rs:25:17
8787
|
8888
LL | { let foo = std::i8::MAX; };
8989
| ^^^^^^^^^^^^ help: try this: `i8::max_value()`
9090

9191
error: using `MAX`
92-
--> $DIR/replace_consts.rs:29:17
92+
--> $DIR/replace_consts.rs:26:17
9393
|
9494
LL | { let foo = std::i16::MAX; };
9595
| ^^^^^^^^^^^^^ help: try this: `i16::max_value()`
9696

9797
error: using `MAX`
98-
--> $DIR/replace_consts.rs:30:17
98+
--> $DIR/replace_consts.rs:27:17
9999
|
100100
LL | { let foo = std::i32::MAX; };
101101
| ^^^^^^^^^^^^^ help: try this: `i32::max_value()`
102102

103103
error: using `MAX`
104-
--> $DIR/replace_consts.rs:31:17
104+
--> $DIR/replace_consts.rs:28:17
105105
|
106106
LL | { let foo = std::i64::MAX; };
107107
| ^^^^^^^^^^^^^ help: try this: `i64::max_value()`
108108

109109
error: using `MAX`
110-
--> $DIR/replace_consts.rs:32:17
110+
--> $DIR/replace_consts.rs:29:17
111111
|
112112
LL | { let foo = std::i128::MAX; };
113113
| ^^^^^^^^^^^^^^ help: try this: `i128::max_value()`
114114

115115
error: using `MAX`
116-
--> $DIR/replace_consts.rs:33:17
116+
--> $DIR/replace_consts.rs:30:17
117117
|
118118
LL | { let foo = std::usize::MAX; };
119119
| ^^^^^^^^^^^^^^^ help: try this: `usize::max_value()`
120120

121121
error: using `MAX`
122-
--> $DIR/replace_consts.rs:34:17
122+
--> $DIR/replace_consts.rs:31:17
123123
|
124124
LL | { let foo = std::u8::MAX; };
125125
| ^^^^^^^^^^^^ help: try this: `u8::max_value()`
126126

127127
error: using `MAX`
128-
--> $DIR/replace_consts.rs:35:17
128+
--> $DIR/replace_consts.rs:32:17
129129
|
130130
LL | { let foo = std::u16::MAX; };
131131
| ^^^^^^^^^^^^^ help: try this: `u16::max_value()`
132132

133133
error: using `MAX`
134-
--> $DIR/replace_consts.rs:36:17
134+
--> $DIR/replace_consts.rs:33:17
135135
|
136136
LL | { let foo = std::u32::MAX; };
137137
| ^^^^^^^^^^^^^ help: try this: `u32::max_value()`
138138

139139
error: using `MAX`
140-
--> $DIR/replace_consts.rs:37:17
140+
--> $DIR/replace_consts.rs:34:17
141141
|
142142
LL | { let foo = std::u64::MAX; };
143143
| ^^^^^^^^^^^^^ help: try this: `u64::max_value()`
144144

145145
error: using `MAX`
146-
--> $DIR/replace_consts.rs:38:17
146+
--> $DIR/replace_consts.rs:35:17
147147
|
148148
LL | { let foo = std::u128::MAX; };
149149
| ^^^^^^^^^^^^^^ help: try this: `u128::max_value()`

0 commit comments

Comments
 (0)