Skip to content

Commit 7d03dcd

Browse files
committed
Feedback
1 parent 8fb3982 commit 7d03dcd

9 files changed

+76
-46
lines changed
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
//@ no-prefer-dynamic
2-
31
#![crate_type = "dylib"]

tests/ui/attributes/no_link/multiple-crates-and-no_link.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
//! Regression test for #13560. Previously, it was possible to
2+
//! trigger an assert in crate numbering if a series of crates
3+
//! being loaded included a "syntax-only" extern crate.
4+
//! But it appears we don't mess with crate numbering for
5+
//! `#[no_link]` crates anymore, so this test doesn't seem
6+
//! to test anything now.
7+
18
//@ run-pass
2-
//@ ignore-cross-compile (needs dylibs and compiletest doesn't have a more specific header)
9+
//@ needs-crate-type: dylib
310
//@ aux-build:empty-crate-1.rs
411
//@ aux-build:empty-crate-2.rs
512
//@ aux-build:no_link-crate.rs
613

7-
// Regression test for issue #13560, the test itself is all in the dependent
8-
// libraries. The fail which previously failed to compile is `no_link_crate`.
9-
1014
extern crate empty_crate_2 as t2;
1115
extern crate no_link_crate as t3;
1216

tests/ui/attributes/no_link/no-link-unknown-crate.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
//! Unfortunately the development of `#[phase]` and `#[no_link]`
2+
//! predates Zulip, and thus has been lost in the sands of time.
3+
//! Understanding the true nature of this test has been left as
4+
//! an exercise for the reader.
5+
//!
6+
//! But we guess from the git history that originally this
7+
//! test was supposed to check that we error if we can't find
8+
//! an extern crate annotated with `#[phase(syntax)]`,
9+
//! see `macro-crate-unknown-crate.rs` in
10+
//! <https://github.com/rust-lang/rust/pull/11151>. Later, we changed
11+
//! `#[phase]` to `#![feature(plugin)]` and added a `#[no_link]`.
12+
//!
13+
//! I suppose that this now tests that we still error if we can't
14+
//! find a `#[no_link]` extern crate?
15+
116
#[no_link]
217
extern crate doesnt_exist; //~ ERROR can't find crate
318

tests/ui/attributes/no_link/no-link-unknown-crate.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0463]: can't find crate for `doesnt_exist`
2-
--> $DIR/no-link-unknown-crate.rs:2:1
2+
--> $DIR/no-link-unknown-crate.rs:17:1
33
|
44
LL | extern crate doesnt_exist;
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

tests/ui/cross-crate/llvm-miscompile-MarkValue-MaybeLive.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/76387>
2+
//! Tests that LLVM doesn't miscompile this
3+
//! See upstream fix: <https://reviews.llvm.org/D88529>.
4+
15
//@ compile-flags: -C opt-level=3
26
//@ aux-build: llvm-miscompile-MarkValue-MaybeLive.rs
37
//@ run-pass
48

5-
// Regression test for <https://github.com/rust-lang/rust/issues/76387>
6-
// Tests that LLVM doesn't miscompile this
7-
89
extern crate llvm_miscompile_MarkValue_MaybeLive;
910

1011
use llvm_miscompile_MarkValue_MaybeLive::FatPtr;

tests/ui/macros/non-fmt-panic.fixed

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//! The non_fmt_panics lint detects panic!(..) invocations where
2+
//! the first argument is not a formatting string.
3+
//!
4+
//! Also, this test checks that this is not emitted if it originates
5+
//! in an external macro.
6+
17
//@ run-rustfix
28
//@ rustfix-only-machine-applicable
39
//@ build-pass (FIXME(62277): should be check-pass)

tests/ui/macros/non-fmt-panic.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
//! The non_fmt_panics lint detects panic!(..) invocations where
2+
//! the first argument is not a formatting string.
3+
//!
4+
//! Also, this test checks that this is not emitted if it originates
5+
//! in an external macro.
6+
17
//@ run-rustfix
28
//@ rustfix-only-machine-applicable
39
//@ build-pass (FIXME(62277): should be check-pass)

tests/ui/macros/non-fmt-panic.stderr

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
warning: panic message contains a brace
2-
--> $DIR/non-fmt-panic.rs:13:29
2+
--> $DIR/non-fmt-panic.rs:19:29
33
|
44
LL | panic!("here's a brace: {");
55
| ^
@@ -12,7 +12,7 @@ LL | panic!("{}", "here's a brace: {");
1212
| +++++
1313

1414
warning: panic message contains a brace
15-
--> $DIR/non-fmt-panic.rs:14:35
15+
--> $DIR/non-fmt-panic.rs:20:35
1616
|
1717
LL | unreachable!("here's a brace: {");
1818
| ^
@@ -24,7 +24,7 @@ LL | unreachable!("{}", "here's a brace: {");
2424
| +++++
2525

2626
warning: panic message contains a brace
27-
--> $DIR/non-fmt-panic.rs:15:31
27+
--> $DIR/non-fmt-panic.rs:21:31
2828
|
2929
LL | std::panic!("another one: }");
3030
| ^
@@ -36,7 +36,7 @@ LL | std::panic!("{}", "another one: }");
3636
| +++++
3737

3838
warning: panic message contains an unused formatting placeholder
39-
--> $DIR/non-fmt-panic.rs:16:25
39+
--> $DIR/non-fmt-panic.rs:22:25
4040
|
4141
LL | core::panic!("Hello {}");
4242
| ^^
@@ -52,7 +52,7 @@ LL | core::panic!("{}", "Hello {}");
5252
| +++++
5353

5454
warning: panic message contains unused formatting placeholders
55-
--> $DIR/non-fmt-panic.rs:17:21
55+
--> $DIR/non-fmt-panic.rs:23:21
5656
|
5757
LL | assert!(false, "{:03x} {test} bla");
5858
| ^^^^^^ ^^^^^^
@@ -68,7 +68,7 @@ LL | assert!(false, "{}", "{:03x} {test} bla");
6868
| +++++
6969

7070
warning: panic message is not a string literal
71-
--> $DIR/non-fmt-panic.rs:19:20
71+
--> $DIR/non-fmt-panic.rs:25:20
7272
|
7373
LL | assert!(false, S);
7474
| ^
@@ -81,7 +81,7 @@ LL | assert!(false, "{}", S);
8181
| +++++
8282

8383
warning: panic message is not a string literal
84-
--> $DIR/non-fmt-panic.rs:21:20
84+
--> $DIR/non-fmt-panic.rs:27:20
8585
|
8686
LL | assert!(false, 123);
8787
| ^^^
@@ -94,7 +94,7 @@ LL | assert!(false, "{}", 123);
9494
| +++++
9595

9696
warning: panic message is not a string literal
97-
--> $DIR/non-fmt-panic.rs:23:20
97+
--> $DIR/non-fmt-panic.rs:29:20
9898
|
9999
LL | assert!(false, Some(123));
100100
| ^^^^^^^^^
@@ -107,7 +107,7 @@ LL | assert!(false, "{:?}", Some(123));
107107
| +++++++
108108

109109
warning: panic message contains braces
110-
--> $DIR/non-fmt-panic.rs:25:27
110+
--> $DIR/non-fmt-panic.rs:31:27
111111
|
112112
LL | debug_assert!(false, "{{}} bla");
113113
| ^^^^
@@ -119,7 +119,7 @@ LL | debug_assert!(false, "{}", "{{}} bla");
119119
| +++++
120120

121121
warning: panic message is not a string literal
122-
--> $DIR/non-fmt-panic.rs:26:12
122+
--> $DIR/non-fmt-panic.rs:32:12
123123
|
124124
LL | panic!(C);
125125
| ^
@@ -132,7 +132,7 @@ LL | panic!("{}", C);
132132
| +++++
133133

134134
warning: panic message is not a string literal
135-
--> $DIR/non-fmt-panic.rs:27:12
135+
--> $DIR/non-fmt-panic.rs:33:12
136136
|
137137
LL | panic!(S);
138138
| ^
@@ -145,7 +145,7 @@ LL | panic!("{}", S);
145145
| +++++
146146

147147
warning: panic message is not a string literal
148-
--> $DIR/non-fmt-panic.rs:28:18
148+
--> $DIR/non-fmt-panic.rs:34:18
149149
|
150150
LL | unreachable!(S);
151151
| ^
@@ -158,7 +158,7 @@ LL | unreachable!("{}", S);
158158
| +++++
159159

160160
warning: panic message is not a string literal
161-
--> $DIR/non-fmt-panic.rs:29:18
161+
--> $DIR/non-fmt-panic.rs:35:18
162162
|
163163
LL | unreachable!(S);
164164
| ^
@@ -171,7 +171,7 @@ LL | unreachable!("{}", S);
171171
| +++++
172172

173173
warning: panic message is not a string literal
174-
--> $DIR/non-fmt-panic.rs:30:17
174+
--> $DIR/non-fmt-panic.rs:36:17
175175
|
176176
LL | std::panic!(123);
177177
| ^^^
@@ -189,7 +189,7 @@ LL + std::panic::panic_any(123);
189189
|
190190

191191
warning: panic message is not a string literal
192-
--> $DIR/non-fmt-panic.rs:31:18
192+
--> $DIR/non-fmt-panic.rs:37:18
193193
|
194194
LL | core::panic!(&*"abc");
195195
| ^^^^^^^
@@ -202,7 +202,7 @@ LL | core::panic!("{}", &*"abc");
202202
| +++++
203203

204204
warning: panic message is not a string literal
205-
--> $DIR/non-fmt-panic.rs:32:12
205+
--> $DIR/non-fmt-panic.rs:38:12
206206
|
207207
LL | panic!(Some(123));
208208
| ^^^^^^^^^
@@ -220,7 +220,7 @@ LL + std::panic::panic_any(Some(123));
220220
|
221221

222222
warning: panic message contains an unused formatting placeholder
223-
--> $DIR/non-fmt-panic.rs:33:12
223+
--> $DIR/non-fmt-panic.rs:39:12
224224
|
225225
LL | panic!(concat!("{", "}"));
226226
| ^^^^^^^^^^^^^^^^^
@@ -236,7 +236,7 @@ LL | panic!("{}", concat!("{", "}"));
236236
| +++++
237237

238238
warning: panic message contains braces
239-
--> $DIR/non-fmt-panic.rs:34:5
239+
--> $DIR/non-fmt-panic.rs:40:5
240240
|
241241
LL | panic!(concat!("{", "{"));
242242
| ^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -248,15 +248,15 @@ LL | panic!("{}", concat!("{", "{"));
248248
| +++++
249249

250250
warning: panic message contains an unused formatting placeholder
251-
--> $DIR/non-fmt-panic.rs:36:37
251+
--> $DIR/non-fmt-panic.rs:42:37
252252
|
253253
LL | fancy_panic::fancy_panic!("test {} 123");
254254
| ^^
255255
|
256256
= note: this message is not used as a format string when given without arguments, but will be in Rust 2021
257257

258258
warning: panic message is not a string literal
259-
--> $DIR/non-fmt-panic.rs:46:12
259+
--> $DIR/non-fmt-panic.rs:52:12
260260
|
261261
LL | panic!(a!());
262262
| ^^^^
@@ -274,7 +274,7 @@ LL + std::panic::panic_any(a!());
274274
|
275275

276276
warning: panic message is not a string literal
277-
--> $DIR/non-fmt-panic.rs:47:18
277+
--> $DIR/non-fmt-panic.rs:53:18
278278
|
279279
LL | unreachable!(a!());
280280
| ^^^^
@@ -287,7 +287,7 @@ LL | unreachable!("{}", a!());
287287
| +++++
288288

289289
warning: panic message is not a string literal
290-
--> $DIR/non-fmt-panic.rs:49:12
290+
--> $DIR/non-fmt-panic.rs:55:12
291291
|
292292
LL | panic!(format!("{}", 1));
293293
| ^^^^^^^^^^^^^^^^
@@ -302,7 +302,7 @@ LL + panic!("{}", 1);
302302
|
303303

304304
warning: panic message is not a string literal
305-
--> $DIR/non-fmt-panic.rs:50:18
305+
--> $DIR/non-fmt-panic.rs:56:18
306306
|
307307
LL | unreachable!(format!("{}", 1));
308308
| ^^^^^^^^^^^^^^^^
@@ -317,7 +317,7 @@ LL + unreachable!("{}", 1);
317317
|
318318

319319
warning: panic message is not a string literal
320-
--> $DIR/non-fmt-panic.rs:51:20
320+
--> $DIR/non-fmt-panic.rs:57:20
321321
|
322322
LL | assert!(false, format!("{}", 1));
323323
| ^^^^^^^^^^^^^^^^
@@ -332,7 +332,7 @@ LL + assert!(false, "{}", 1);
332332
|
333333

334334
warning: panic message is not a string literal
335-
--> $DIR/non-fmt-panic.rs:52:26
335+
--> $DIR/non-fmt-panic.rs:58:26
336336
|
337337
LL | debug_assert!(false, format!("{}", 1));
338338
| ^^^^^^^^^^^^^^^^
@@ -347,7 +347,7 @@ LL + debug_assert!(false, "{}", 1);
347347
|
348348

349349
warning: panic message is not a string literal
350-
--> $DIR/non-fmt-panic.rs:54:12
350+
--> $DIR/non-fmt-panic.rs:60:12
351351
|
352352
LL | panic![123];
353353
| ^^^
@@ -365,7 +365,7 @@ LL + std::panic::panic_any(123);
365365
|
366366

367367
warning: panic message is not a string literal
368-
--> $DIR/non-fmt-panic.rs:55:12
368+
--> $DIR/non-fmt-panic.rs:61:12
369369
|
370370
LL | panic!{123};
371371
| ^^^
@@ -383,7 +383,7 @@ LL + std::panic::panic_any(123);
383383
|
384384

385385
warning: panic message is not a string literal
386-
--> $DIR/non-fmt-panic.rs:72:12
386+
--> $DIR/non-fmt-panic.rs:78:12
387387
|
388388
LL | panic!(v);
389389
| ------ ^
@@ -394,7 +394,7 @@ LL | panic!(v);
394394
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
395395

396396
warning: panic message is not a string literal
397-
--> $DIR/non-fmt-panic.rs:73:20
397+
--> $DIR/non-fmt-panic.rs:79:20
398398
|
399399
LL | assert!(false, v);
400400
| ^
@@ -403,7 +403,7 @@ LL | assert!(false, v);
403403
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/panic-macro-consistency.html>
404404

405405
warning: panic message is not a string literal
406-
--> $DIR/non-fmt-panic.rs:77:12
406+
--> $DIR/non-fmt-panic.rs:83:12
407407
|
408408
LL | panic!(v);
409409
| ^
@@ -421,7 +421,7 @@ LL + std::panic::panic_any(v);
421421
|
422422

423423
warning: panic message is not a string literal
424-
--> $DIR/non-fmt-panic.rs:78:20
424+
--> $DIR/non-fmt-panic.rs:84:20
425425
|
426426
LL | assert!(false, v);
427427
| ^
@@ -434,7 +434,7 @@ LL | assert!(false, "{:?}", v);
434434
| +++++++
435435

436436
warning: panic message is not a string literal
437-
--> $DIR/non-fmt-panic.rs:82:12
437+
--> $DIR/non-fmt-panic.rs:88:12
438438
|
439439
LL | panic!(v);
440440
| ^
@@ -452,7 +452,7 @@ LL + std::panic::panic_any(v);
452452
|
453453

454454
warning: panic message is not a string literal
455-
--> $DIR/non-fmt-panic.rs:83:20
455+
--> $DIR/non-fmt-panic.rs:89:20
456456
|
457457
LL | assert!(false, v);
458458
| ^
@@ -465,7 +465,7 @@ LL | assert!(false, "{}", v);
465465
| +++++
466466

467467
warning: panic message is not a string literal
468-
--> $DIR/non-fmt-panic.rs:87:12
468+
--> $DIR/non-fmt-panic.rs:93:12
469469
|
470470
LL | panic!(v);
471471
| ^
@@ -483,7 +483,7 @@ LL + std::panic::panic_any(v);
483483
|
484484

485485
warning: panic message is not a string literal
486-
--> $DIR/non-fmt-panic.rs:88:20
486+
--> $DIR/non-fmt-panic.rs:94:20
487487
|
488488
LL | assert!(false, v);
489489
| ^

0 commit comments

Comments
 (0)