From 7363728d18659c695453cc6f6923c70a2554b1d4 Mon Sep 17 00:00:00 2001 From: flip1995 Date: Tue, 4 Feb 2020 16:13:06 +0100 Subject: [PATCH] Update remaining test files --- tests/ui/collapsible_else_if.fixed | 58 ++++++++++++++--------------- tests/ui/collapsible_else_if.stderr | 58 ++++++++++++++--------------- tests/ui/collapsible_if.fixed | 28 +++++++------- tests/ui/collapsible_if.stderr | 28 +++++++------- tests/ui/match_bool.stderr | 20 +++++----- tests/ui/single_match.stderr | 4 +- tests/ui/single_match_else.stderr | 6 +-- 7 files changed, 101 insertions(+), 101 deletions(-) diff --git a/tests/ui/collapsible_else_if.fixed b/tests/ui/collapsible_else_if.fixed index a31f748670c..c4149ad19c1 100644 --- a/tests/ui/collapsible_else_if.fixed +++ b/tests/ui/collapsible_else_if.fixed @@ -10,57 +10,57 @@ fn main() { if x == "hello" { print!("Hello "); } else if y == "world" { - println!("world!") -} + println!("world!") + } if x == "hello" { print!("Hello "); } else if let Some(42) = Some(42) { - println!("world!") -} + println!("world!") + } if x == "hello" { print!("Hello "); } else if y == "world" { - println!("world") -} -else { - println!("!") -} + println!("world") + } + else { + println!("!") + } if x == "hello" { print!("Hello "); } else if let Some(42) = Some(42) { - println!("world") -} -else { - println!("!") -} + println!("world") + } + else { + println!("!") + } if let Some(42) = Some(42) { print!("Hello "); } else if let Some(42) = Some(42) { - println!("world") -} -else { - println!("!") -} + println!("world") + } + else { + println!("!") + } if let Some(42) = Some(42) { print!("Hello "); } else if x == "hello" { - println!("world") -} -else { - println!("!") -} + println!("world") + } + else { + println!("!") + } if let Some(42) = Some(42) { print!("Hello "); } else if let Some(42) = Some(42) { - println!("world") -} -else { - println!("!") -} + println!("world") + } + else { + println!("!") + } } diff --git a/tests/ui/collapsible_else_if.stderr b/tests/ui/collapsible_else_if.stderr index 26e3635c2d1..28048999e8e 100644 --- a/tests/ui/collapsible_else_if.stderr +++ b/tests/ui/collapsible_else_if.stderr @@ -13,8 +13,8 @@ LL | | } help: try | LL | } else if y == "world" { -LL | println!("world!") -LL | } +LL | println!("world!") +LL | } | error: this `else { if .. }` block can be collapsed @@ -31,8 +31,8 @@ LL | | } help: try | LL | } else if let Some(42) = Some(42) { -LL | println!("world!") -LL | } +LL | println!("world!") +LL | } | error: this `else { if .. }` block can be collapsed @@ -51,11 +51,11 @@ LL | | } help: try | LL | } else if y == "world" { -LL | println!("world") -LL | } -LL | else { -LL | println!("!") -LL | } +LL | println!("world") +LL | } +LL | else { +LL | println!("!") +LL | } | error: this `else { if .. }` block can be collapsed @@ -74,11 +74,11 @@ LL | | } help: try | LL | } else if let Some(42) = Some(42) { -LL | println!("world") -LL | } -LL | else { -LL | println!("!") -LL | } +LL | println!("world") +LL | } +LL | else { +LL | println!("!") +LL | } | error: this `else { if .. }` block can be collapsed @@ -97,11 +97,11 @@ LL | | } help: try | LL | } else if let Some(42) = Some(42) { -LL | println!("world") -LL | } -LL | else { -LL | println!("!") -LL | } +LL | println!("world") +LL | } +LL | else { +LL | println!("!") +LL | } | error: this `else { if .. }` block can be collapsed @@ -120,11 +120,11 @@ LL | | } help: try | LL | } else if x == "hello" { -LL | println!("world") -LL | } -LL | else { -LL | println!("!") -LL | } +LL | println!("world") +LL | } +LL | else { +LL | println!("!") +LL | } | error: this `else { if .. }` block can be collapsed @@ -143,11 +143,11 @@ LL | | } help: try | LL | } else if let Some(42) = Some(42) { -LL | println!("world") -LL | } -LL | else { -LL | println!("!") -LL | } +LL | println!("world") +LL | } +LL | else { +LL | println!("!") +LL | } | error: aborting due to 7 previous errors diff --git a/tests/ui/collapsible_if.fixed b/tests/ui/collapsible_if.fixed index e8f90b3164a..076771f5c57 100644 --- a/tests/ui/collapsible_if.fixed +++ b/tests/ui/collapsible_if.fixed @@ -7,28 +7,28 @@ fn main() { let x = "hello"; let y = "world"; if x == "hello" && y == "world" { - println!("Hello world!"); -} + println!("Hello world!"); + } if (x == "hello" || x == "world") && (y == "world" || y == "hello") { - println!("Hello world!"); -} + println!("Hello world!"); + } if x == "hello" && x == "world" && (y == "world" || y == "hello") { - println!("Hello world!"); -} + println!("Hello world!"); + } if (x == "hello" || x == "world") && y == "world" && y == "hello" { - println!("Hello world!"); -} + println!("Hello world!"); + } if x == "hello" && x == "world" && y == "world" && y == "hello" { - println!("Hello world!"); -} + println!("Hello world!"); + } if 42 == 1337 && 'a' != 'A' { - println!("world!") -} + println!("world!") + } // Works because any if with an else statement cannot be collapsed. if x == "hello" { @@ -81,8 +81,8 @@ fn main() { } if x == "hello" && y == "world" { // Collapsible - println!("Hello world!"); -} + println!("Hello world!"); + } if x == "hello" { print!("Hello "); diff --git a/tests/ui/collapsible_if.stderr b/tests/ui/collapsible_if.stderr index b123bc1c7bd..6440ff41be8 100644 --- a/tests/ui/collapsible_if.stderr +++ b/tests/ui/collapsible_if.stderr @@ -12,8 +12,8 @@ LL | | } help: try | LL | if x == "hello" && y == "world" { -LL | println!("Hello world!"); -LL | } +LL | println!("Hello world!"); +LL | } | error: this `if` statement can be collapsed @@ -29,8 +29,8 @@ LL | | } help: try | LL | if (x == "hello" || x == "world") && (y == "world" || y == "hello") { -LL | println!("Hello world!"); -LL | } +LL | println!("Hello world!"); +LL | } | error: this `if` statement can be collapsed @@ -46,8 +46,8 @@ LL | | } help: try | LL | if x == "hello" && x == "world" && (y == "world" || y == "hello") { -LL | println!("Hello world!"); -LL | } +LL | println!("Hello world!"); +LL | } | error: this `if` statement can be collapsed @@ -63,8 +63,8 @@ LL | | } help: try | LL | if (x == "hello" || x == "world") && y == "world" && y == "hello" { -LL | println!("Hello world!"); -LL | } +LL | println!("Hello world!"); +LL | } | error: this `if` statement can be collapsed @@ -80,8 +80,8 @@ LL | | } help: try | LL | if x == "hello" && x == "world" && y == "world" && y == "hello" { -LL | println!("Hello world!"); -LL | } +LL | println!("Hello world!"); +LL | } | error: this `if` statement can be collapsed @@ -97,8 +97,8 @@ LL | | } help: try | LL | if 42 == 1337 && 'a' != 'A' { -LL | println!("world!") -LL | } +LL | println!("world!") +LL | } | error: this `if` statement can be collapsed @@ -114,8 +114,8 @@ LL | | } help: try | LL | if x == "hello" && y == "world" { // Collapsible -LL | println!("Hello world!"); -LL | } +LL | println!("Hello world!"); +LL | } | error: aborting due to 7 previous errors diff --git a/tests/ui/match_bool.stderr b/tests/ui/match_bool.stderr index 42f20862939..d0c20eb2696 100644 --- a/tests/ui/match_bool.stderr +++ b/tests/ui/match_bool.stderr @@ -40,8 +40,8 @@ LL | | }; help: consider using an `if`/`else` expression | LL | if !test { -LL | println!("Noooo!"); -LL | }; +LL | println!("Noooo!"); +LL | }; | error: you seem to be trying to match on a boolean expression @@ -58,8 +58,8 @@ LL | | }; help: consider using an `if`/`else` expression | LL | if !test { -LL | println!("Noooo!"); -LL | }; +LL | println!("Noooo!"); +LL | }; | error: you seem to be trying to match on a boolean expression @@ -76,8 +76,8 @@ LL | | }; help: consider using an `if`/`else` expression | LL | if !(test && test) { -LL | println!("Noooo!"); -LL | }; +LL | println!("Noooo!"); +LL | }; | error: equal expressions as operands to `&&` @@ -103,10 +103,10 @@ LL | | }; help: consider using an `if`/`else` expression | LL | if test { -LL | println!("Yes!"); -LL | } else { -LL | println!("Noooo!"); -LL | }; +LL | println!("Yes!"); +LL | } else { +LL | println!("Noooo!"); +LL | }; | error: aborting due to 8 previous errors diff --git a/tests/ui/single_match.stderr b/tests/ui/single_match.stderr index 80ddeabdb2f..f69554d75f9 100644 --- a/tests/ui/single_match.stderr +++ b/tests/ui/single_match.stderr @@ -13,8 +13,8 @@ LL | | }; help: try this | LL | if let Some(y) = x { -LL | println!("{:?}", y); -LL | }; +LL | println!("{:?}", y); +LL | }; | error: you seem to be trying to use match for destructuring a single pattern. Consider using `if let` diff --git a/tests/ui/single_match_else.stderr b/tests/ui/single_match_else.stderr index 3f29f5aaf6a..59861d46eb3 100644 --- a/tests/ui/single_match_else.stderr +++ b/tests/ui/single_match_else.stderr @@ -14,9 +14,9 @@ LL | | } help: try this | LL | if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else { -LL | let x = 5; -LL | None -LL | } +LL | let x = 5; +LL | None +LL | } | error: aborting due to previous error