Skip to content

Commit 8a41720

Browse files
committed
Remove tests for deprecated items
1 parent 7b90cb5 commit 8a41720

File tree

2 files changed

+16
-35
lines changed

2 files changed

+16
-35
lines changed

tests/ui/non_copy_const.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
use std::borrow::Cow;
55
use std::cell::Cell;
66
use std::fmt::Display;
7-
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
7+
use std::sync::atomic::{AtomicUsize, Ordering};
88
use std::sync::Once;
99

1010
const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
@@ -95,9 +95,6 @@ fn main() {
9595
ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
9696
assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
9797

98-
ATOMIC_USIZE_INIT.store(2, Ordering::SeqCst); //~ ERROR interior mutability
99-
assert_eq!(ATOMIC_USIZE_INIT.load(Ordering::SeqCst), 0); //~ ERROR interior mutability
100-
10198
let _once = ONCE_INIT;
10299
let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
103100
let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability

tests/ui/non_copy_const.stderr

+15-31
Original file line numberDiff line numberDiff line change
@@ -144,132 +144,116 @@ LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutabi
144144
= help: assign this const to a local or static variable, and use the variable here
145145

146146
error: a const item with interior mutability should not be borrowed
147-
--> $DIR/non_copy_const.rs:98:5
148-
|
149-
LL | ATOMIC_USIZE_INIT.store(2, Ordering::SeqCst); //~ ERROR interior mutability
150-
| ^^^^^^^^^^^^^^^^^
151-
|
152-
= help: assign this const to a local or static variable, and use the variable here
153-
154-
error: a const item with interior mutability should not be borrowed
155-
--> $DIR/non_copy_const.rs:99:16
156-
|
157-
LL | assert_eq!(ATOMIC_USIZE_INIT.load(Ordering::SeqCst), 0); //~ ERROR interior mutability
158-
| ^^^^^^^^^^^^^^^^^
159-
|
160-
= help: assign this const to a local or static variable, and use the variable here
161-
162-
error: a const item with interior mutability should not be borrowed
163-
--> $DIR/non_copy_const.rs:102:22
147+
--> $DIR/non_copy_const.rs:99:22
164148
|
165149
LL | let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
166150
| ^^^^^^^^^
167151
|
168152
= help: assign this const to a local or static variable, and use the variable here
169153

170154
error: a const item with interior mutability should not be borrowed
171-
--> $DIR/non_copy_const.rs:103:25
155+
--> $DIR/non_copy_const.rs:100:25
172156
|
173157
LL | let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
174158
| ^^^^^^^^^
175159
|
176160
= help: assign this const to a local or static variable, and use the variable here
177161

178162
error: a const item with interior mutability should not be borrowed
179-
--> $DIR/non_copy_const.rs:104:27
163+
--> $DIR/non_copy_const.rs:101:27
180164
|
181165
LL | let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
182166
| ^^^^^^^^^
183167
|
184168
= help: assign this const to a local or static variable, and use the variable here
185169

186170
error: a const item with interior mutability should not be borrowed
187-
--> $DIR/non_copy_const.rs:105:26
171+
--> $DIR/non_copy_const.rs:102:26
188172
|
189173
LL | let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
190174
| ^^^^^^^^^
191175
|
192176
= help: assign this const to a local or static variable, and use the variable here
193177

194178
error: a const item with interior mutability should not be borrowed
195-
--> $DIR/non_copy_const.rs:116:14
179+
--> $DIR/non_copy_const.rs:113:14
196180
|
197181
LL | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
198182
| ^^^^^^^^^^^^
199183
|
200184
= help: assign this const to a local or static variable, and use the variable here
201185

202186
error: a const item with interior mutability should not be borrowed
203-
--> $DIR/non_copy_const.rs:117:14
187+
--> $DIR/non_copy_const.rs:114:14
204188
|
205189
LL | let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
206190
| ^^^^^^^^^^^^
207191
|
208192
= help: assign this const to a local or static variable, and use the variable here
209193

210194
error: a const item with interior mutability should not be borrowed
211-
--> $DIR/non_copy_const.rs:118:19
195+
--> $DIR/non_copy_const.rs:115:19
212196
|
213197
LL | let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
214198
| ^^^^^^^^^^^^
215199
|
216200
= help: assign this const to a local or static variable, and use the variable here
217201

218202
error: a const item with interior mutability should not be borrowed
219-
--> $DIR/non_copy_const.rs:119:14
203+
--> $DIR/non_copy_const.rs:116:14
220204
|
221205
LL | let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
222206
| ^^^^^^^^^^^^
223207
|
224208
= help: assign this const to a local or static variable, and use the variable here
225209

226210
error: a const item with interior mutability should not be borrowed
227-
--> $DIR/non_copy_const.rs:120:13
211+
--> $DIR/non_copy_const.rs:117:13
228212
|
229213
LL | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
230214
| ^^^^^^^^^^^^
231215
|
232216
= help: assign this const to a local or static variable, and use the variable here
233217

234218
error: a const item with interior mutability should not be borrowed
235-
--> $DIR/non_copy_const.rs:126:13
219+
--> $DIR/non_copy_const.rs:123:13
236220
|
237221
LL | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
238222
| ^^^^^^^^^^^^
239223
|
240224
= help: assign this const to a local or static variable, and use the variable here
241225

242226
error: a const item with interior mutability should not be borrowed
243-
--> $DIR/non_copy_const.rs:131:5
227+
--> $DIR/non_copy_const.rs:128:5
244228
|
245229
LL | CELL.set(2); //~ ERROR interior mutability
246230
| ^^^^
247231
|
248232
= help: assign this const to a local or static variable, and use the variable here
249233

250234
error: a const item with interior mutability should not be borrowed
251-
--> $DIR/non_copy_const.rs:132:16
235+
--> $DIR/non_copy_const.rs:129:16
252236
|
253237
LL | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
254238
| ^^^^
255239
|
256240
= help: assign this const to a local or static variable, and use the variable here
257241

258242
error: a const item with interior mutability should not be borrowed
259-
--> $DIR/non_copy_const.rs:145:5
243+
--> $DIR/non_copy_const.rs:142:5
260244
|
261245
LL | u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
262246
| ^^^^^^^^^^^
263247
|
264248
= help: assign this const to a local or static variable, and use the variable here
265249

266250
error: a const item with interior mutability should not be borrowed
267-
--> $DIR/non_copy_const.rs:146:16
251+
--> $DIR/non_copy_const.rs:143:16
268252
|
269253
LL | assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
270254
| ^^^^^^^^^^^
271255
|
272256
= help: assign this const to a local or static variable, and use the variable here
273257

274-
error: aborting due to 31 previous errors
258+
error: aborting due to 29 previous errors
275259

0 commit comments

Comments
 (0)