summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/match_single_binding.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/clippy/tests/ui/match_single_binding.stderr')
-rw-r--r--src/tools/clippy/tests/ui/match_single_binding.stderr111
1 files changed, 93 insertions, 18 deletions
diff --git a/src/tools/clippy/tests/ui/match_single_binding.stderr b/src/tools/clippy/tests/ui/match_single_binding.stderr
index e960d64ad..9d16af76c 100644
--- a/src/tools/clippy/tests/ui/match_single_binding.stderr
+++ b/src/tools/clippy/tests/ui/match_single_binding.stderr
@@ -1,5 +1,5 @@
error: this match could be written as a `let` statement
- --> $DIR/match_single_binding.rs:28:5
+ --> $DIR/match_single_binding.rs:33:5
|
LL | / match (a, b, c) {
LL | | (x, y, z) => {
@@ -18,7 +18,7 @@ LL + }
|
error: this match could be written as a `let` statement
- --> $DIR/match_single_binding.rs:34:5
+ --> $DIR/match_single_binding.rs:39:5
|
LL | / match (a, b, c) {
LL | | (x, y, z) => println!("{} {} {}", x, y, z),
@@ -32,7 +32,7 @@ LL + println!("{} {} {}", x, y, z);
|
error: this match could be replaced by its body itself
- --> $DIR/match_single_binding.rs:51:5
+ --> $DIR/match_single_binding.rs:56:5
|
LL | / match a {
LL | | _ => println!("whatever"),
@@ -40,7 +40,7 @@ LL | | }
| |_____^ help: consider using the match body instead: `println!("whatever");`
error: this match could be replaced by its body itself
- --> $DIR/match_single_binding.rs:55:5
+ --> $DIR/match_single_binding.rs:60:5
|
LL | / match a {
LL | | _ => {
@@ -59,7 +59,7 @@ LL + }
|
error: this match could be replaced by its body itself
- --> $DIR/match_single_binding.rs:62:5
+ --> $DIR/match_single_binding.rs:67:5
|
LL | / match a {
LL | | _ => {
@@ -81,7 +81,7 @@ LL + }
|
error: this match could be written as a `let` statement
- --> $DIR/match_single_binding.rs:72:5
+ --> $DIR/match_single_binding.rs:77:5
|
LL | / match p {
LL | | Point { x, y } => println!("Coords: ({}, {})", x, y),
@@ -95,7 +95,7 @@ LL + println!("Coords: ({}, {})", x, y);
|
error: this match could be written as a `let` statement
- --> $DIR/match_single_binding.rs:76:5
+ --> $DIR/match_single_binding.rs:81:5
|
LL | / match p {
LL | | Point { x: x1, y: y1 } => println!("Coords: ({}, {})", x1, y1),
@@ -109,7 +109,7 @@ LL + println!("Coords: ({}, {})", x1, y1);
|
error: this match could be written as a `let` statement
- --> $DIR/match_single_binding.rs:81:5
+ --> $DIR/match_single_binding.rs:86:5
|
LL | / match x {
LL | | ref r => println!("Got a reference to {}", r),
@@ -123,7 +123,7 @@ LL + println!("Got a reference to {}", r);
|
error: this match could be written as a `let` statement
- --> $DIR/match_single_binding.rs:86:5
+ --> $DIR/match_single_binding.rs:91:5
|
LL | / match x {
LL | | ref mut mr => println!("Got a mutable reference to {}", mr),
@@ -137,7 +137,7 @@ LL + println!("Got a mutable reference to {}", mr);
|
error: this match could be written as a `let` statement
- --> $DIR/match_single_binding.rs:90:5
+ --> $DIR/match_single_binding.rs:95:5
|
LL | / let product = match coords() {
LL | | Point { x, y } => x * y,
@@ -151,7 +151,7 @@ LL + let product = x * y;
|
error: this match could be written as a `let` statement
- --> $DIR/match_single_binding.rs:98:18
+ --> $DIR/match_single_binding.rs:103:18
|
LL | .map(|i| match i.unwrap() {
| __________________^
@@ -168,16 +168,16 @@ LL ~ })
|
error: this match could be replaced by its body itself
- --> $DIR/match_single_binding.rs:124:5
+ --> $DIR/match_single_binding.rs:129:5
|
LL | / match x {
LL | | // =>
LL | | _ => println!("Not an array index start"),
LL | | }
- | |_____^ help: consider using the match body instead: `println!("Not an array index start");`
+ | |_____^ help: consider using the match body instead: `println!("Not an array index start")`
error: this assignment could be simplified
- --> $DIR/match_single_binding.rs:134:5
+ --> $DIR/match_single_binding.rs:138:5
|
LL | / val = match val.split_at(idx) {
LL | | (pre, suf) => {
@@ -197,7 +197,7 @@ LL ~ };
|
error: this match could be replaced by its scrutinee and body
- --> $DIR/match_single_binding.rs:147:16
+ --> $DIR/match_single_binding.rs:151:16
|
LL | let _ = || match side_effects() {
| ________________^
@@ -209,12 +209,12 @@ help: consider using the scrutinee and body instead
|
LL ~ let _ = || {
LL + side_effects();
-LL + println!("Needs curlies");
+LL + println!("Needs curlies")
LL ~ };
|
error: this match could be written as a `let` statement
- --> $DIR/match_single_binding.rs:154:5
+ --> $DIR/match_single_binding.rs:157:5
|
LL | / match r {
LL | | x => match x {
@@ -238,5 +238,80 @@ LL + },
LL ~ };
|
-error: aborting due to 15 previous errors
+error: this match could be replaced by its body itself
+ --> $DIR/match_single_binding.rs:170:5
+ |
+LL | / match 1 {
+LL | | _ => (),
+LL | | }
+ | |_____^ help: consider using the match body instead: `();`
+
+error: this match could be replaced by its body itself
+ --> $DIR/match_single_binding.rs:174:13
+ |
+LL | let a = match 1 {
+ | _____________^
+LL | | _ => (),
+LL | | };
+ | |_____^ help: consider using the match body instead: `()`
+
+error: this match could be replaced by its body itself
+ --> $DIR/match_single_binding.rs:178:5
+ |
+LL | / match 1 {
+LL | | _ => side_effects(),
+LL | | }
+ | |_____^ help: consider using the match body instead: `side_effects();`
+
+error: this match could be replaced by its body itself
+ --> $DIR/match_single_binding.rs:182:13
+ |
+LL | let b = match 1 {
+ | _____________^
+LL | | _ => side_effects(),
+LL | | };
+ | |_____^ help: consider using the match body instead: `side_effects()`
+
+error: this match could be replaced by its body itself
+ --> $DIR/match_single_binding.rs:186:5
+ |
+LL | / match 1 {
+LL | | _ => println!("1"),
+LL | | }
+ | |_____^ help: consider using the match body instead: `println!("1");`
+
+error: this match could be replaced by its body itself
+ --> $DIR/match_single_binding.rs:190:13
+ |
+LL | let c = match 1 {
+ | _____________^
+LL | | _ => println!("1"),
+LL | | };
+ | |_____^ help: consider using the match body instead: `println!("1")`
+
+error: this match could be replaced by its body itself
+ --> $DIR/match_single_binding.rs:195:9
+ |
+LL | / match 1 {
+LL | | _ => (),
+LL | | },
+ | |_________^ help: consider using the match body instead: `()`
+
+error: this match could be replaced by its body itself
+ --> $DIR/match_single_binding.rs:198:9
+ |
+LL | / match 1 {
+LL | | _ => side_effects(),
+LL | | },
+ | |_________^ help: consider using the match body instead: `side_effects()`
+
+error: this match could be replaced by its body itself
+ --> $DIR/match_single_binding.rs:201:9
+ |
+LL | / match 1 {
+LL | | _ => println!("1"),
+LL | | },
+ | |_________^ help: consider using the match body instead: `println!("1")`
+
+error: aborting due to 24 previous errors