From fa8161ba2e36cd5ca6e17bf2b09c4307e7e4e2eb Mon Sep 17 00:00:00 2001 From: Michael Recachinas Date: Mon, 2 Apr 2018 21:31:41 +0100 Subject: [PATCH] Revert adding env! to tests --- tests/ui/print_literal.rs | 6 --- tests/ui/print_literal.stderr | 74 ++++++++++++++++------------------- 2 files changed, 34 insertions(+), 46 deletions(-) diff --git a/tests/ui/print_literal.rs b/tests/ui/print_literal.rs index d920e6fa3d26..c803294ab0ad 100644 --- a/tests/ui/print_literal.rs +++ b/tests/ui/print_literal.rs @@ -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"); diff --git a/tests/ui/print_literal.stderr b/tests/ui/print_literal.stderr index 8adeedfc8bd8..982be7dc5373 100644 --- a/tests/ui/print_literal.stderr +++ b/tests/ui/print_literal.stderr @@ -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"); - | ^^^^^^^ - -error: printing a literal with an empty format string - --> $DIR/print_literal.rs:21:36 - | -21 | println!("Hello {} {}", world, "world"); +15 | println!("Hello {} {}", world, "world"); | ^^^^^^^ error: printing a literal with an empty format string - --> $DIR/print_literal.rs:22:26 + --> $DIR/print_literal.rs:16:26 | -22 | println!("Hello {}", "world"); +16 | println!("Hello {}", "world"); | ^^^^^^^ error: printing a literal with an empty format string - --> $DIR/print_literal.rs:23:30 + --> $DIR/print_literal.rs:17: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