Skip to content

Commit 5c10db3

Browse files
committed
More tests
1 parent 0fcb4fc commit 5c10db3

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
println!("Test", 123, 456, 789);
13+
14+
println!("Test2",
15+
123,
16+
456,
17+
789
18+
);
19+
20+
println!("Some stuff", UNUSED="args");
21+
22+
println!("Some more $STUFF",
23+
"woo!",
24+
STUFF=
25+
"things"
26+
, UNUSED="args");
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
error: multiple unused formatting arguments
2+
--> $DIR/format-unused-lables.rs:12:5
3+
|
4+
12 | println!("Test", 123, 456, 789);
5+
| ^^^^^^^^^^^^^^^^^---^^---^^---^^
6+
| | | |
7+
| | | unused
8+
| | unused
9+
| unused
10+
|
11+
= note: this error originates in a macro outside of the current crate
12+
13+
error: multiple unused formatting arguments
14+
--> $DIR/format-unused-lables.rs:14:5
15+
|
16+
14 | / println!("Test2",
17+
15 | | 123,
18+
| | --- unused
19+
16 | | 456,
20+
| | --- unused
21+
17 | | 789
22+
| | --- unused
23+
18 | | );
24+
| |______^
25+
|
26+
= note: this error originates in a macro outside of the current crate
27+
28+
error: named argument never used
29+
--> $DIR/format-unused-lables.rs:20:35
30+
|
31+
20 | println!("Some stuff", UNUSED="args");
32+
| ^^^^^^
33+
34+
error: multiple unused formatting arguments
35+
--> $DIR/format-unused-lables.rs:22:5
36+
|
37+
22 | / println!("Some more $STUFF",
38+
23 | | "woo!",
39+
| | ------ unused
40+
24 | | STUFF=
41+
25 | | "things"
42+
| | -------- unused
43+
26 | | , UNUSED="args");
44+
| |_______________________------_^
45+
| |
46+
| unused
47+
|
48+
= help: `$STUFF` should be written as `{STUFF}`
49+
= note: shell formatting not supported; see the documentation for `std::fmt`
50+
= note: this error originates in a macro outside of the current crate
51+
52+
error: aborting due to 4 previous errors
53+

0 commit comments

Comments
 (0)