diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/tools/clippy/tests/ui/collapsible_match2.stderr | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/tests/ui/collapsible_match2.stderr | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/src/tools/clippy/tests/ui/collapsible_match2.stderr b/src/tools/clippy/tests/ui/collapsible_match2.stderr new file mode 100644 index 000000000..fe64e4693 --- /dev/null +++ b/src/tools/clippy/tests/ui/collapsible_match2.stderr @@ -0,0 +1,97 @@ +error: this `match` can be collapsed into the outer `match` + --> $DIR/collapsible_match2.rs:13:34 + | +LL | Ok(val) if make() => match val { + | __________________________________^ +LL | | Some(n) => foo(n), +LL | | _ => return, +LL | | }, + | |_____________^ + | + = note: `-D clippy::collapsible-match` implied by `-D warnings` +help: the outer pattern can be modified to include the inner pattern + --> $DIR/collapsible_match2.rs:13:16 + | +LL | Ok(val) if make() => match val { + | ^^^ replace this binding +LL | Some(n) => foo(n), + | ^^^^^^^ with this pattern + +error: this `match` can be collapsed into the outer `match` + --> $DIR/collapsible_match2.rs:20:24 + | +LL | Ok(val) => match val { + | ________________________^ +LL | | Some(n) => foo(n), +LL | | _ => return, +LL | | }, + | |_____________^ + | +help: the outer pattern can be modified to include the inner pattern + --> $DIR/collapsible_match2.rs:20:16 + | +LL | Ok(val) => match val { + | ^^^ replace this binding +LL | Some(n) => foo(n), + | ^^^^^^^ with this pattern + +error: this `match` can be collapsed into the outer `match` + --> $DIR/collapsible_match2.rs:34:29 + | +LL | $pat => match $e { + | _____________________________^ +LL | | $inner_pat => $then, +LL | | _ => return, +LL | | }, + | |_____________________^ +... +LL | mac!(res_opt => Ok(val), val => Some(n), foo(n)); + | ------------------------------------------------ in this macro invocation + | +help: the outer pattern can be modified to include the inner pattern + --> $DIR/collapsible_match2.rs:46:28 + | +LL | mac!(res_opt => Ok(val), val => Some(n), foo(n)); + | ^^^ ^^^^^^^ with this pattern + | | + | replace this binding + = note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info) + +error: this `match` can be collapsed into the outer `match` + --> $DIR/collapsible_match2.rs:51:20 + | +LL | Some(s) => match *s { + | ____________________^ +LL | | [n] => foo(n), +LL | | _ => (), +LL | | }, + | |_________^ + | +help: the outer pattern can be modified to include the inner pattern + --> $DIR/collapsible_match2.rs:51:14 + | +LL | Some(s) => match *s { + | ^ replace this binding +LL | [n] => foo(n), + | ^^^ with this pattern + +error: this `match` can be collapsed into the outer `match` + --> $DIR/collapsible_match2.rs:60:24 + | +LL | Some(ref s) => match s { + | ________________________^ +LL | | [n] => foo(n), +LL | | _ => (), +LL | | }, + | |_________^ + | +help: the outer pattern can be modified to include the inner pattern + --> $DIR/collapsible_match2.rs:60:14 + | +LL | Some(ref s) => match s { + | ^^^^^ replace this binding +LL | [n] => foo(n), + | ^^^ with this pattern + +error: aborting due to 5 previous errors + |