From 5381c4fcf63171d1dedcf5163426b6f9410d1b03 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Tue, 25 Apr 2017 10:57:44 +0200 Subject: [PATCH] Update ui tests to new rustc range printing --- tests/ui/copies.stderr | 20 ++++++++------------ tests/ui/needless_continue.stderr | 9 ++++----- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/tests/ui/copies.stderr b/tests/ui/copies.stderr index f0dd409e2b2..05c5e92a7fa 100644 --- a/tests/ui/copies.stderr +++ b/tests/ui/copies.stderr @@ -3,18 +3,16 @@ warning: This else block is redundant. --> $DIR/copies.rs:128:20 | 128 | } else { - | ____________________^ starting here... + | ____________________^ 129 | | continue; 130 | | } - | |_____________^ ...ending here + | |_____________^ | = note: #[warn(needless_continue)] on by default = help: Consider dropping the else clause and merging the code that follows (in the loop) with the if block, like so: if true { - break; - - // Merged code follows... - + break; + // Merged code follows... } @@ -23,18 +21,16 @@ warning: This else block is redundant. --> $DIR/copies.rs:138:20 | 138 | } else { - | ____________________^ starting here... + | ____________________^ 139 | | continue; 140 | | } - | |_____________^ ...ending here + | |_____________^ | = note: #[warn(needless_continue)] on by default = help: Consider dropping the else clause and merging the code that follows (in the loop) with the if block, like so: if true { - break; - - // Merged code follows... - + break; + // Merged code follows... } diff --git a/tests/ui/needless_continue.stderr b/tests/ui/needless_continue.stderr index 5a4447aa694..50be062a67b 100644 --- a/tests/ui/needless_continue.stderr +++ b/tests/ui/needless_continue.stderr @@ -3,10 +3,10 @@ error: This else block is redundant. --> $DIR/needless_continue.rs:26:16 | 26 | } else { - | ________________^ starting here... + | ________________^ 27 | | continue; 28 | | } - | |_________^ ...ending here + | |_________^ | note: lint level defined here --> $DIR/needless_continue.rs:12:8 @@ -43,14 +43,13 @@ error: There is no need for an explicit `else` block for this `if` expression --> $DIR/needless_continue.rs:41:9 | -41 | if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 { - | _________^ starting here... +41 | / if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 { 42 | | continue; 43 | | } else { 44 | | println!("Blabber"); 45 | | println!("Jabber"); 46 | | } - | |_________^ ...ending here + | |_________^ | = help: Consider dropping the else clause, and moving out the code in the else block, like so: if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 { -- 2.44.0