mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
More tests
This commit is contained in:
parent
0fcb4fca19
commit
5c10db3f94
27
src/test/ui/macros/format-unused-lables.rs
Normal file
27
src/test/ui/macros/format-unused-lables.rs
Normal file
@ -0,0 +1,27 @@
|
||||
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
|
||||
// file at the top-level directory of this distribution and at
|
||||
// http://rust-lang.org/COPYRIGHT.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
||||
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
||||
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
println!("Test", 123, 456, 789);
|
||||
|
||||
println!("Test2",
|
||||
123,
|
||||
456,
|
||||
789
|
||||
);
|
||||
|
||||
println!("Some stuff", UNUSED="args");
|
||||
|
||||
println!("Some more $STUFF",
|
||||
"woo!",
|
||||
STUFF=
|
||||
"things"
|
||||
, UNUSED="args");
|
||||
}
|
53
src/test/ui/macros/format-unused-lables.stderr
Normal file
53
src/test/ui/macros/format-unused-lables.stderr
Normal file
@ -0,0 +1,53 @@
|
||||
error: multiple unused formatting arguments
|
||||
--> $DIR/format-unused-lables.rs:12:5
|
||||
|
|
||||
12 | println!("Test", 123, 456, 789);
|
||||
| ^^^^^^^^^^^^^^^^^---^^---^^---^^
|
||||
| | | |
|
||||
| | | unused
|
||||
| | unused
|
||||
| unused
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate
|
||||
|
||||
error: multiple unused formatting arguments
|
||||
--> $DIR/format-unused-lables.rs:14:5
|
||||
|
|
||||
14 | / println!("Test2",
|
||||
15 | | 123,
|
||||
| | --- unused
|
||||
16 | | 456,
|
||||
| | --- unused
|
||||
17 | | 789
|
||||
| | --- unused
|
||||
18 | | );
|
||||
| |______^
|
||||
|
|
||||
= note: this error originates in a macro outside of the current crate
|
||||
|
||||
error: named argument never used
|
||||
--> $DIR/format-unused-lables.rs:20:35
|
||||
|
|
||||
20 | println!("Some stuff", UNUSED="args");
|
||||
| ^^^^^^
|
||||
|
||||
error: multiple unused formatting arguments
|
||||
--> $DIR/format-unused-lables.rs:22:5
|
||||
|
|
||||
22 | / println!("Some more $STUFF",
|
||||
23 | | "woo!",
|
||||
| | ------ unused
|
||||
24 | | STUFF=
|
||||
25 | | "things"
|
||||
| | -------- unused
|
||||
26 | | , UNUSED="args");
|
||||
| |_______________________------_^
|
||||
| |
|
||||
| unused
|
||||
|
|
||||
= help: `$STUFF` should be written as `{STUFF}`
|
||||
= note: shell formatting not supported; see the documentation for `std::fmt`
|
||||
= note: this error originates in a macro outside of the current crate
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
Loading…
Reference in New Issue
Block a user