Skip to content

Commit 9fb63d5

Browse files
authored
Merge pull request #2574 from mark-i-m/i128
i128 is stabilizing
2 parents 2dedbdc + e9f6a7c commit 9fb63d5

File tree

3 files changed

+80
-73
lines changed

3 files changed

+80
-73
lines changed

clippy_lints/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
#![feature(box_syntax)]
44
#![feature(custom_attribute)]
5-
#![feature(i128_type)]
6-
#![feature(i128)]
75
#![feature(rustc_private)]
86
#![feature(slice_patterns)]
97
#![feature(stmt_expr_attributes)]
@@ -13,6 +11,10 @@
1311
#![allow(unknown_lints, indexing_slicing, shadow_reuse, missing_docs_in_private_items)]
1412
#![recursion_limit = "256"]
1513

14+
// FIXME(mark-i-m) remove after i128 stablization merges
15+
#![allow(stable_features)]
16+
#![feature(i128, i128_type)]
17+
1618
#[macro_use]
1719
extern crate rustc;
1820
extern crate rustc_typeck;

tests/ui/replace_consts.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
#![feature(integer_atomics, i128, i128_type)]
1+
#![feature(integer_atomics)]
22
#![allow(blacklisted_name)]
33
#![deny(replace_consts)]
4+
5+
// FIXME(mark-i-m) remove after i128 stablization merges
6+
#![allow(stable_features)]
7+
#![feature(i128, i128_type)]
8+
49
use std::sync::atomic::*;
510
use std::sync::{ONCE_INIT, Once};
611

tests/ui/replace_consts.stderr

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
error: using `ATOMIC_BOOL_INIT`
2-
--> $DIR/replace_consts.rs:11:17
2+
--> $DIR/replace_consts.rs:16:17
33
|
4-
11 | { let foo = ATOMIC_BOOL_INIT; };
4+
16 | { let foo = ATOMIC_BOOL_INIT; };
55
| ^^^^^^^^^^^^^^^^ help: try this: `AtomicBool::new(false)`
66
|
77
note: lint level defined here
@@ -11,207 +11,207 @@ note: lint level defined here
1111
| ^^^^^^^^^^^^^^
1212

1313
error: using `ATOMIC_ISIZE_INIT`
14-
--> $DIR/replace_consts.rs:12:17
14+
--> $DIR/replace_consts.rs:17:17
1515
|
16-
12 | { let foo = ATOMIC_ISIZE_INIT; };
16+
17 | { let foo = ATOMIC_ISIZE_INIT; };
1717
| ^^^^^^^^^^^^^^^^^ help: try this: `AtomicIsize::new(0)`
1818

1919
error: using `ATOMIC_I8_INIT`
20-
--> $DIR/replace_consts.rs:13:17
20+
--> $DIR/replace_consts.rs:18:17
2121
|
22-
13 | { let foo = ATOMIC_I8_INIT; };
22+
18 | { let foo = ATOMIC_I8_INIT; };
2323
| ^^^^^^^^^^^^^^ help: try this: `AtomicI8::new(0)`
2424

2525
error: using `ATOMIC_I16_INIT`
26-
--> $DIR/replace_consts.rs:14:17
26+
--> $DIR/replace_consts.rs:19:17
2727
|
28-
14 | { let foo = ATOMIC_I16_INIT; };
28+
19 | { let foo = ATOMIC_I16_INIT; };
2929
| ^^^^^^^^^^^^^^^ help: try this: `AtomicI16::new(0)`
3030

3131
error: using `ATOMIC_I32_INIT`
32-
--> $DIR/replace_consts.rs:15:17
32+
--> $DIR/replace_consts.rs:20:17
3333
|
34-
15 | { let foo = ATOMIC_I32_INIT; };
34+
20 | { let foo = ATOMIC_I32_INIT; };
3535
| ^^^^^^^^^^^^^^^ help: try this: `AtomicI32::new(0)`
3636

3737
error: using `ATOMIC_I64_INIT`
38-
--> $DIR/replace_consts.rs:16:17
38+
--> $DIR/replace_consts.rs:21:17
3939
|
40-
16 | { let foo = ATOMIC_I64_INIT; };
40+
21 | { let foo = ATOMIC_I64_INIT; };
4141
| ^^^^^^^^^^^^^^^ help: try this: `AtomicI64::new(0)`
4242

4343
error: using `ATOMIC_USIZE_INIT`
44-
--> $DIR/replace_consts.rs:17:17
44+
--> $DIR/replace_consts.rs:22:17
4545
|
46-
17 | { let foo = ATOMIC_USIZE_INIT; };
46+
22 | { let foo = ATOMIC_USIZE_INIT; };
4747
| ^^^^^^^^^^^^^^^^^ help: try this: `AtomicUsize::new(0)`
4848

4949
error: using `ATOMIC_U8_INIT`
50-
--> $DIR/replace_consts.rs:18:17
50+
--> $DIR/replace_consts.rs:23:17
5151
|
52-
18 | { let foo = ATOMIC_U8_INIT; };
52+
23 | { let foo = ATOMIC_U8_INIT; };
5353
| ^^^^^^^^^^^^^^ help: try this: `AtomicU8::new(0)`
5454

5555
error: using `ATOMIC_U16_INIT`
56-
--> $DIR/replace_consts.rs:19:17
56+
--> $DIR/replace_consts.rs:24:17
5757
|
58-
19 | { let foo = ATOMIC_U16_INIT; };
58+
24 | { let foo = ATOMIC_U16_INIT; };
5959
| ^^^^^^^^^^^^^^^ help: try this: `AtomicU16::new(0)`
6060

6161
error: using `ATOMIC_U32_INIT`
62-
--> $DIR/replace_consts.rs:20:17
62+
--> $DIR/replace_consts.rs:25:17
6363
|
64-
20 | { let foo = ATOMIC_U32_INIT; };
64+
25 | { let foo = ATOMIC_U32_INIT; };
6565
| ^^^^^^^^^^^^^^^ help: try this: `AtomicU32::new(0)`
6666

6767
error: using `ATOMIC_U64_INIT`
68-
--> $DIR/replace_consts.rs:21:17
68+
--> $DIR/replace_consts.rs:26:17
6969
|
70-
21 | { let foo = ATOMIC_U64_INIT; };
70+
26 | { let foo = ATOMIC_U64_INIT; };
7171
| ^^^^^^^^^^^^^^^ help: try this: `AtomicU64::new(0)`
7272

7373
error: using `MIN`
74-
--> $DIR/replace_consts.rs:23:17
74+
--> $DIR/replace_consts.rs:28:17
7575
|
76-
23 | { let foo = std::isize::MIN; };
76+
28 | { let foo = std::isize::MIN; };
7777
| ^^^^^^^^^^^^^^^ help: try this: `isize::min_value()`
7878

7979
error: using `MIN`
80-
--> $DIR/replace_consts.rs:24:17
80+
--> $DIR/replace_consts.rs:29:17
8181
|
82-
24 | { let foo = std::i8::MIN; };
82+
29 | { let foo = std::i8::MIN; };
8383
| ^^^^^^^^^^^^ help: try this: `i8::min_value()`
8484

8585
error: using `MIN`
86-
--> $DIR/replace_consts.rs:25:17
86+
--> $DIR/replace_consts.rs:30:17
8787
|
88-
25 | { let foo = std::i16::MIN; };
88+
30 | { let foo = std::i16::MIN; };
8989
| ^^^^^^^^^^^^^ help: try this: `i16::min_value()`
9090

9191
error: using `MIN`
92-
--> $DIR/replace_consts.rs:26:17
92+
--> $DIR/replace_consts.rs:31:17
9393
|
94-
26 | { let foo = std::i32::MIN; };
94+
31 | { let foo = std::i32::MIN; };
9595
| ^^^^^^^^^^^^^ help: try this: `i32::min_value()`
9696

9797
error: using `MIN`
98-
--> $DIR/replace_consts.rs:27:17
98+
--> $DIR/replace_consts.rs:32:17
9999
|
100-
27 | { let foo = std::i64::MIN; };
100+
32 | { let foo = std::i64::MIN; };
101101
| ^^^^^^^^^^^^^ help: try this: `i64::min_value()`
102102

103103
error: using `MIN`
104-
--> $DIR/replace_consts.rs:28:17
104+
--> $DIR/replace_consts.rs:33:17
105105
|
106-
28 | { let foo = std::i128::MIN; };
106+
33 | { let foo = std::i128::MIN; };
107107
| ^^^^^^^^^^^^^^ help: try this: `i128::min_value()`
108108

109109
error: using `MIN`
110-
--> $DIR/replace_consts.rs:29:17
110+
--> $DIR/replace_consts.rs:34:17
111111
|
112-
29 | { let foo = std::usize::MIN; };
112+
34 | { let foo = std::usize::MIN; };
113113
| ^^^^^^^^^^^^^^^ help: try this: `usize::min_value()`
114114

115115
error: using `MIN`
116-
--> $DIR/replace_consts.rs:30:17
116+
--> $DIR/replace_consts.rs:35:17
117117
|
118-
30 | { let foo = std::u8::MIN; };
118+
35 | { let foo = std::u8::MIN; };
119119
| ^^^^^^^^^^^^ help: try this: `u8::min_value()`
120120

121121
error: using `MIN`
122-
--> $DIR/replace_consts.rs:31:17
122+
--> $DIR/replace_consts.rs:36:17
123123
|
124-
31 | { let foo = std::u16::MIN; };
124+
36 | { let foo = std::u16::MIN; };
125125
| ^^^^^^^^^^^^^ help: try this: `u16::min_value()`
126126

127127
error: using `MIN`
128-
--> $DIR/replace_consts.rs:32:17
128+
--> $DIR/replace_consts.rs:37:17
129129
|
130-
32 | { let foo = std::u32::MIN; };
130+
37 | { let foo = std::u32::MIN; };
131131
| ^^^^^^^^^^^^^ help: try this: `u32::min_value()`
132132

133133
error: using `MIN`
134-
--> $DIR/replace_consts.rs:33:17
134+
--> $DIR/replace_consts.rs:38:17
135135
|
136-
33 | { let foo = std::u64::MIN; };
136+
38 | { let foo = std::u64::MIN; };
137137
| ^^^^^^^^^^^^^ help: try this: `u64::min_value()`
138138

139139
error: using `MIN`
140-
--> $DIR/replace_consts.rs:34:17
140+
--> $DIR/replace_consts.rs:39:17
141141
|
142-
34 | { let foo = std::u128::MIN; };
142+
39 | { let foo = std::u128::MIN; };
143143
| ^^^^^^^^^^^^^^ help: try this: `u128::min_value()`
144144

145145
error: using `MAX`
146-
--> $DIR/replace_consts.rs:36:17
146+
--> $DIR/replace_consts.rs:41:17
147147
|
148-
36 | { let foo = std::isize::MAX; };
148+
41 | { let foo = std::isize::MAX; };
149149
| ^^^^^^^^^^^^^^^ help: try this: `isize::max_value()`
150150

151151
error: using `MAX`
152-
--> $DIR/replace_consts.rs:37:17
152+
--> $DIR/replace_consts.rs:42:17
153153
|
154-
37 | { let foo = std::i8::MAX; };
154+
42 | { let foo = std::i8::MAX; };
155155
| ^^^^^^^^^^^^ help: try this: `i8::max_value()`
156156

157157
error: using `MAX`
158-
--> $DIR/replace_consts.rs:38:17
158+
--> $DIR/replace_consts.rs:43:17
159159
|
160-
38 | { let foo = std::i16::MAX; };
160+
43 | { let foo = std::i16::MAX; };
161161
| ^^^^^^^^^^^^^ help: try this: `i16::max_value()`
162162

163163
error: using `MAX`
164-
--> $DIR/replace_consts.rs:39:17
164+
--> $DIR/replace_consts.rs:44:17
165165
|
166-
39 | { let foo = std::i32::MAX; };
166+
44 | { let foo = std::i32::MAX; };
167167
| ^^^^^^^^^^^^^ help: try this: `i32::max_value()`
168168

169169
error: using `MAX`
170-
--> $DIR/replace_consts.rs:40:17
170+
--> $DIR/replace_consts.rs:45:17
171171
|
172-
40 | { let foo = std::i64::MAX; };
172+
45 | { let foo = std::i64::MAX; };
173173
| ^^^^^^^^^^^^^ help: try this: `i64::max_value()`
174174

175175
error: using `MAX`
176-
--> $DIR/replace_consts.rs:41:17
176+
--> $DIR/replace_consts.rs:46:17
177177
|
178-
41 | { let foo = std::i128::MAX; };
178+
46 | { let foo = std::i128::MAX; };
179179
| ^^^^^^^^^^^^^^ help: try this: `i128::max_value()`
180180

181181
error: using `MAX`
182-
--> $DIR/replace_consts.rs:42:17
182+
--> $DIR/replace_consts.rs:47:17
183183
|
184-
42 | { let foo = std::usize::MAX; };
184+
47 | { let foo = std::usize::MAX; };
185185
| ^^^^^^^^^^^^^^^ help: try this: `usize::max_value()`
186186

187187
error: using `MAX`
188-
--> $DIR/replace_consts.rs:43:17
188+
--> $DIR/replace_consts.rs:48:17
189189
|
190-
43 | { let foo = std::u8::MAX; };
190+
48 | { let foo = std::u8::MAX; };
191191
| ^^^^^^^^^^^^ help: try this: `u8::max_value()`
192192

193193
error: using `MAX`
194-
--> $DIR/replace_consts.rs:44:17
194+
--> $DIR/replace_consts.rs:49:17
195195
|
196-
44 | { let foo = std::u16::MAX; };
196+
49 | { let foo = std::u16::MAX; };
197197
| ^^^^^^^^^^^^^ help: try this: `u16::max_value()`
198198

199199
error: using `MAX`
200-
--> $DIR/replace_consts.rs:45:17
200+
--> $DIR/replace_consts.rs:50:17
201201
|
202-
45 | { let foo = std::u32::MAX; };
202+
50 | { let foo = std::u32::MAX; };
203203
| ^^^^^^^^^^^^^ help: try this: `u32::max_value()`
204204

205205
error: using `MAX`
206-
--> $DIR/replace_consts.rs:46:17
206+
--> $DIR/replace_consts.rs:51:17
207207
|
208-
46 | { let foo = std::u64::MAX; };
208+
51 | { let foo = std::u64::MAX; };
209209
| ^^^^^^^^^^^^^ help: try this: `u64::max_value()`
210210

211211
error: using `MAX`
212-
--> $DIR/replace_consts.rs:47:17
212+
--> $DIR/replace_consts.rs:52:17
213213
|
214-
47 | { let foo = std::u128::MAX; };
214+
52 | { let foo = std::u128::MAX; };
215215
| ^^^^^^^^^^^^^^ help: try this: `u128::max_value()`
216216

217217
error: aborting due to 35 previous errors

0 commit comments

Comments
 (0)