mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
Revert adding env! to tests
This commit is contained in:
parent
d504290839
commit
fa8161ba2e
2 changed files with 34 additions and 46 deletions
|
@ -10,12 +10,6 @@ fn main() {
|
|||
println!("Hello {}", world);
|
||||
println!("3 in hex is {:X}", 3);
|
||||
|
||||
// this in theory shouldn't yield a warning,
|
||||
// but at present time, it's a known edge case
|
||||
// that isn't handled (because we can't expand
|
||||
// `println!` and not `env!`)
|
||||
println!("foo: {}", env!("BAR"));
|
||||
|
||||
// these should throw warnings
|
||||
print!("Hello {}", "world");
|
||||
println!("Hello {} {}", world, "world");
|
||||
|
|
|
@ -1,106 +1,100 @@
|
|||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:17:25
|
||||
--> $DIR/print_literal.rs:14:24
|
||||
|
|
||||
17 | println!("foo: {}", env!("BAR"));
|
||||
| ^^^^^^^^^^^
|
||||
14 | print!("Hello {}", "world");
|
||||
| ^^^^^^^
|
||||
|
|
||||
= note: `-D print-literal` implied by `-D warnings`
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:20:24
|
||||
--> $DIR/print_literal.rs:15:36
|
||||
|
|
||||
20 | print!("Hello {}", "world");
|
||||
15 | println!("Hello {} {}", world, "world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:21:36
|
||||
--> $DIR/print_literal.rs:16:26
|
||||
|
|
||||
21 | println!("Hello {} {}", world, "world");
|
||||
16 | println!("Hello {}", "world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:22:26
|
||||
--> $DIR/print_literal.rs:17:30
|
||||
|
|
||||
22 | println!("Hello {}", "world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:23:30
|
||||
|
|
||||
23 | println!("10 / 4 is {}", 2.5);
|
||||
17 | println!("10 / 4 is {}", 2.5);
|
||||
| ^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:24:28
|
||||
--> $DIR/print_literal.rs:18:28
|
||||
|
|
||||
24 | println!("2 + 1 = {}", 3);
|
||||
18 | println!("2 + 1 = {}", 3);
|
||||
| ^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:25:31
|
||||
--> $DIR/print_literal.rs:19:31
|
||||
|
|
||||
25 | println!("2 + 1 = {:.4}", 3);
|
||||
19 | println!("2 + 1 = {:.4}", 3);
|
||||
| ^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:26:32
|
||||
--> $DIR/print_literal.rs:20:32
|
||||
|
|
||||
26 | println!("2 + 1 = {:5.4}", 3);
|
||||
20 | println!("2 + 1 = {:5.4}", 3);
|
||||
| ^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:27:33
|
||||
--> $DIR/print_literal.rs:21:33
|
||||
|
|
||||
27 | println!("Debug test {:?}", "hello, world");
|
||||
21 | println!("Debug test {:?}", "hello, world");
|
||||
| ^^^^^^^^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:32:25
|
||||
--> $DIR/print_literal.rs:26:25
|
||||
|
|
||||
32 | println!("{0} {1}", "hello", "world");
|
||||
26 | println!("{0} {1}", "hello", "world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:32:34
|
||||
--> $DIR/print_literal.rs:26:34
|
||||
|
|
||||
32 | println!("{0} {1}", "hello", "world");
|
||||
26 | println!("{0} {1}", "hello", "world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:33:25
|
||||
--> $DIR/print_literal.rs:27:25
|
||||
|
|
||||
33 | println!("{1} {0}", "hello", "world");
|
||||
27 | println!("{1} {0}", "hello", "world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:33:34
|
||||
--> $DIR/print_literal.rs:27:34
|
||||
|
|
||||
33 | println!("{1} {0}", "hello", "world");
|
||||
27 | println!("{1} {0}", "hello", "world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:36:33
|
||||
--> $DIR/print_literal.rs:30:33
|
||||
|
|
||||
36 | println!("{foo} {bar}", foo="hello", bar="world");
|
||||
30 | println!("{foo} {bar}", foo="hello", bar="world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:36:46
|
||||
--> $DIR/print_literal.rs:30:46
|
||||
|
|
||||
36 | println!("{foo} {bar}", foo="hello", bar="world");
|
||||
30 | println!("{foo} {bar}", foo="hello", bar="world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:37:33
|
||||
--> $DIR/print_literal.rs:31:33
|
||||
|
|
||||
37 | println!("{bar} {foo}", foo="hello", bar="world");
|
||||
31 | println!("{bar} {foo}", foo="hello", bar="world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: printing a literal with an empty format string
|
||||
--> $DIR/print_literal.rs:37:46
|
||||
--> $DIR/print_literal.rs:31:46
|
||||
|
|
||||
37 | println!("{bar} {foo}", foo="hello", bar="world");
|
||||
31 | println!("{bar} {foo}", foo="hello", bar="world");
|
||||
| ^^^^^^^
|
||||
|
||||
error: aborting due to 17 previous errors
|
||||
error: aborting due to 16 previous errors
|
||||
|
||||
|
|
Loading…
Reference in a new issue