Skip to content

Commit

Permalink
Update remaining test files
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Feb 4, 2020
1 parent 0db8e59 commit 574d4a9
Show file tree
Hide file tree
Showing 7 changed files with 101 additions and 101 deletions.
58 changes: 29 additions & 29 deletions tests/ui/collapsible_else_if.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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!("!")
}
}
58 changes: 29 additions & 29 deletions tests/ui/collapsible_else_if.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
28 changes: 14 additions & 14 deletions tests/ui/collapsible_if.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -81,8 +81,8 @@ fn main() {
}

if x == "hello" && y == "world" { // Collapsible
println!("Hello world!");
}
println!("Hello world!");
}

if x == "hello" {
print!("Hello ");
Expand Down
28 changes: 14 additions & 14 deletions tests/ui/collapsible_if.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions tests/ui/match_bool.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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 `&&`
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/single_match.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
6 changes: 3 additions & 3 deletions tests/ui/single_match_else.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 574d4a9

Please sign in to comment.