Skip to content

Commit 80eb63b

Browse files
committed
Auto merge of #4549 - matthiaskrgr:rustup_15, r=oli-obk
rustup changelog: none
2 parents 535bc1d + 1238742 commit 80eb63b

File tree

3 files changed

+36
-37
lines changed

3 files changed

+36
-37
lines changed

src/driver.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ You can use tool lints to allow or deny lints from your code, eg.:
248248
pub fn main() {
249249
rustc_driver::init_rustc_env_logger();
250250
exit(
251-
rustc_driver::report_ices_to_stderr_if_any(move || {
251+
rustc_driver::catch_fatal_errors(move || {
252252
use std::env;
253253

254254
if std::env::args().any(|a| a == "--version" || a == "-V") {

tests/ui/non_copy_const.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![feature(const_string_new, const_vec_new)]
21
#![allow(clippy::ref_in_deref, dead_code)]
32

43
use std::borrow::Cow;

tests/ui/non_copy_const.stderr

+35-35
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: a const item should never be interior mutable
2-
--> $DIR/non_copy_const.rs:10:1
2+
--> $DIR/non_copy_const.rs:9:1
33
|
44
LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
55
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -9,23 +9,23 @@ LL | const ATOMIC: AtomicUsize = AtomicUsize::new(5); //~ ERROR interior mutable
99
= note: `#[deny(clippy::declare_interior_mutable_const)]` on by default
1010

1111
error: a const item should never be interior mutable
12-
--> $DIR/non_copy_const.rs:11:1
12+
--> $DIR/non_copy_const.rs:10:1
1313
|
1414
LL | const CELL: Cell<usize> = Cell::new(6); //~ ERROR interior mutable
1515
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1616
| |
1717
| help: make this a static item: `static`
1818

1919
error: a const item should never be interior mutable
20-
--> $DIR/non_copy_const.rs:12:1
20+
--> $DIR/non_copy_const.rs:11:1
2121
|
2222
LL | const ATOMIC_TUPLE: ([AtomicUsize; 1], Vec<AtomicUsize>, u8) = ([ATOMIC], Vec::new(), 7);
2323
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2424
| |
2525
| help: make this a static item: `static`
2626

2727
error: a const item should never be interior mutable
28-
--> $DIR/non_copy_const.rs:17:9
28+
--> $DIR/non_copy_const.rs:16:9
2929
|
3030
LL | const $name: $ty = $e;
3131
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -34,49 +34,49 @@ LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
3434
| ------------------------------------------ in this macro invocation
3535

3636
error: a const item should never be interior mutable
37-
--> $DIR/non_copy_const.rs:41:5
37+
--> $DIR/non_copy_const.rs:40:5
3838
|
3939
LL | const ATOMIC: AtomicUsize; //~ ERROR interior mutable
4040
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
4141

4242
error: a const item should never be interior mutable
43-
--> $DIR/non_copy_const.rs:45:5
43+
--> $DIR/non_copy_const.rs:44:5
4444
|
4545
LL | const INPUT: T;
4646
| ^^^^^^^^^^^^^^^
4747
|
4848
help: consider requiring `T` to be `Copy`
49-
--> $DIR/non_copy_const.rs:45:18
49+
--> $DIR/non_copy_const.rs:44:18
5050
|
5151
LL | const INPUT: T;
5252
| ^
5353

5454
error: a const item should never be interior mutable
55-
--> $DIR/non_copy_const.rs:48:5
55+
--> $DIR/non_copy_const.rs:47:5
5656
|
5757
LL | const ASSOC: Self::NonCopyType;
5858
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5959
|
6060
help: consider requiring `<Self as Trait<T>>::NonCopyType` to be `Copy`
61-
--> $DIR/non_copy_const.rs:48:18
61+
--> $DIR/non_copy_const.rs:47:18
6262
|
6363
LL | const ASSOC: Self::NonCopyType;
6464
| ^^^^^^^^^^^^^^^^^
6565

6666
error: a const item should never be interior mutable
67-
--> $DIR/non_copy_const.rs:52:5
67+
--> $DIR/non_copy_const.rs:51:5
6868
|
6969
LL | const AN_INPUT: T = Self::INPUT;
7070
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7171
|
7272
help: consider requiring `T` to be `Copy`
73-
--> $DIR/non_copy_const.rs:52:21
73+
--> $DIR/non_copy_const.rs:51:21
7474
|
7575
LL | const AN_INPUT: T = Self::INPUT;
7676
| ^
7777

7878
error: a const item should never be interior mutable
79-
--> $DIR/non_copy_const.rs:17:9
79+
--> $DIR/non_copy_const.rs:16:9
8080
|
8181
LL | const $name: $ty = $e;
8282
| ^^^^^^^^^^^^^^^^^^^^^^
@@ -85,49 +85,49 @@ LL | declare_const!(ANOTHER_INPUT: T = Self::INPUT); //~ ERROR interior muta
8585
| ----------------------------------------------- in this macro invocation
8686

8787
error: a const item should never be interior mutable
88-
--> $DIR/non_copy_const.rs:61:5
88+
--> $DIR/non_copy_const.rs:60:5
8989
|
9090
LL | const SELF_2: Self;
9191
| ^^^^^^^^^^^^^^^^^^^
9292
|
9393
help: consider requiring `Self` to be `Copy`
94-
--> $DIR/non_copy_const.rs:61:19
94+
--> $DIR/non_copy_const.rs:60:19
9595
|
9696
LL | const SELF_2: Self;
9797
| ^^^^
9898

9999
error: a const item should never be interior mutable
100-
--> $DIR/non_copy_const.rs:82:5
100+
--> $DIR/non_copy_const.rs:81:5
101101
|
102102
LL | const ASSOC_3: AtomicUsize = AtomicUsize::new(14); //~ ERROR interior mutable
103103
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
104104

105105
error: a const item should never be interior mutable
106-
--> $DIR/non_copy_const.rs:85:5
106+
--> $DIR/non_copy_const.rs:84:5
107107
|
108108
LL | const U_SELF: U = U::SELF_2;
109109
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
110110
|
111111
help: consider requiring `U` to be `Copy`
112-
--> $DIR/non_copy_const.rs:85:19
112+
--> $DIR/non_copy_const.rs:84:19
113113
|
114114
LL | const U_SELF: U = U::SELF_2;
115115
| ^
116116

117117
error: a const item should never be interior mutable
118-
--> $DIR/non_copy_const.rs:88:5
118+
--> $DIR/non_copy_const.rs:87:5
119119
|
120120
LL | const T_ASSOC: T::NonCopyType = T::ASSOC;
121121
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
122122
|
123123
help: consider requiring `<T as Trait<u32>>::NonCopyType` to be `Copy`
124-
--> $DIR/non_copy_const.rs:88:20
124+
--> $DIR/non_copy_const.rs:87:20
125125
|
126126
LL | const T_ASSOC: T::NonCopyType = T::ASSOC;
127127
| ^^^^^^^^^^^^^^
128128

129129
error: a const item with interior mutability should not be borrowed
130-
--> $DIR/non_copy_const.rs:95:5
130+
--> $DIR/non_copy_const.rs:94:5
131131
|
132132
LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
133133
| ^^^^^^
@@ -136,119 +136,119 @@ LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
136136
= help: assign this const to a local or static variable, and use the variable here
137137

138138
error: a const item with interior mutability should not be borrowed
139-
--> $DIR/non_copy_const.rs:96:16
139+
--> $DIR/non_copy_const.rs:95:16
140140
|
141141
LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5); //~ ERROR interior mutability
142142
| ^^^^^^
143143
|
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:99:22
147+
--> $DIR/non_copy_const.rs:98:22
148148
|
149149
LL | let _once_ref = &ONCE_INIT; //~ ERROR interior mutability
150150
| ^^^^^^^^^
151151
|
152152
= help: assign this const to a local or static variable, and use the variable here
153153

154154
error: a const item with interior mutability should not be borrowed
155-
--> $DIR/non_copy_const.rs:100:25
155+
--> $DIR/non_copy_const.rs:99:25
156156
|
157157
LL | let _once_ref_2 = &&ONCE_INIT; //~ ERROR interior mutability
158158
| ^^^^^^^^^
159159
|
160160
= help: assign this const to a local or static variable, and use the variable here
161161

162162
error: a const item with interior mutability should not be borrowed
163-
--> $DIR/non_copy_const.rs:101:27
163+
--> $DIR/non_copy_const.rs:100:27
164164
|
165165
LL | let _once_ref_4 = &&&&ONCE_INIT; //~ ERROR interior mutability
166166
| ^^^^^^^^^
167167
|
168168
= help: assign this const to a local or static variable, and use the variable here
169169

170170
error: a const item with interior mutability should not be borrowed
171-
--> $DIR/non_copy_const.rs:102:26
171+
--> $DIR/non_copy_const.rs:101:26
172172
|
173173
LL | let _once_mut = &mut ONCE_INIT; //~ ERROR interior mutability
174174
| ^^^^^^^^^
175175
|
176176
= help: assign this const to a local or static variable, and use the variable here
177177

178178
error: a const item with interior mutability should not be borrowed
179-
--> $DIR/non_copy_const.rs:113:14
179+
--> $DIR/non_copy_const.rs:112:14
180180
|
181181
LL | let _ = &ATOMIC_TUPLE; //~ ERROR interior mutability
182182
| ^^^^^^^^^^^^
183183
|
184184
= help: assign this const to a local or static variable, and use the variable here
185185

186186
error: a const item with interior mutability should not be borrowed
187-
--> $DIR/non_copy_const.rs:114:14
187+
--> $DIR/non_copy_const.rs:113:14
188188
|
189189
LL | let _ = &ATOMIC_TUPLE.0; //~ ERROR interior mutability
190190
| ^^^^^^^^^^^^
191191
|
192192
= help: assign this const to a local or static variable, and use the variable here
193193

194194
error: a const item with interior mutability should not be borrowed
195-
--> $DIR/non_copy_const.rs:115:19
195+
--> $DIR/non_copy_const.rs:114:19
196196
|
197197
LL | let _ = &(&&&&ATOMIC_TUPLE).0; //~ ERROR interior mutability
198198
| ^^^^^^^^^^^^
199199
|
200200
= help: assign this const to a local or static variable, and use the variable here
201201

202202
error: a const item with interior mutability should not be borrowed
203-
--> $DIR/non_copy_const.rs:116:14
203+
--> $DIR/non_copy_const.rs:115:14
204204
|
205205
LL | let _ = &ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
206206
| ^^^^^^^^^^^^
207207
|
208208
= help: assign this const to a local or static variable, and use the variable here
209209

210210
error: a const item with interior mutability should not be borrowed
211-
--> $DIR/non_copy_const.rs:117:13
211+
--> $DIR/non_copy_const.rs:116:13
212212
|
213213
LL | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst); //~ ERROR interior mutability
214214
| ^^^^^^^^^^^^
215215
|
216216
= help: assign this const to a local or static variable, and use the variable here
217217

218218
error: a const item with interior mutability should not be borrowed
219-
--> $DIR/non_copy_const.rs:123:13
219+
--> $DIR/non_copy_const.rs:122:13
220220
|
221221
LL | let _ = ATOMIC_TUPLE.0[0]; //~ ERROR interior mutability
222222
| ^^^^^^^^^^^^
223223
|
224224
= help: assign this const to a local or static variable, and use the variable here
225225

226226
error: a const item with interior mutability should not be borrowed
227-
--> $DIR/non_copy_const.rs:128:5
227+
--> $DIR/non_copy_const.rs:127:5
228228
|
229229
LL | CELL.set(2); //~ ERROR interior mutability
230230
| ^^^^
231231
|
232232
= help: assign this const to a local or static variable, and use the variable here
233233

234234
error: a const item with interior mutability should not be borrowed
235-
--> $DIR/non_copy_const.rs:129:16
235+
--> $DIR/non_copy_const.rs:128:16
236236
|
237237
LL | assert_eq!(CELL.get(), 6); //~ ERROR interior mutability
238238
| ^^^^
239239
|
240240
= help: assign this const to a local or static variable, and use the variable here
241241

242242
error: a const item with interior mutability should not be borrowed
243-
--> $DIR/non_copy_const.rs:142:5
243+
--> $DIR/non_copy_const.rs:141:5
244244
|
245245
LL | u64::ATOMIC.store(5, Ordering::SeqCst); //~ ERROR interior mutability
246246
| ^^^^^^^^^^^
247247
|
248248
= help: assign this const to a local or static variable, and use the variable here
249249

250250
error: a const item with interior mutability should not be borrowed
251-
--> $DIR/non_copy_const.rs:143:16
251+
--> $DIR/non_copy_const.rs:142:16
252252
|
253253
LL | assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9); //~ ERROR interior mutability
254254
| ^^^^^^^^^^^

0 commit comments

Comments
 (0)