rust/tests/ui/manual_let_else.stderr
2022-10-24 22:05:39 +02:00

126 lines
3.5 KiB
Plaintext

error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:17:5
|
LL | let v = if let Some(v_some) = g() { v_some } else { return };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::manual-let-else` implied by `-D warnings`
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:18:5
|
LL | / let v = if let Some(v_some) = g() {
LL | | v_some
LL | | } else {
LL | | return;
LL | | };
| |______^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:24:5
|
LL | / let v = if let Some(v) = g() {
LL | | // Blocks around the identity should have no impact
LL | | {
LL | | { v }
... |
LL | | return;
LL | | };
| |______^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:37:9
|
LL | let v = if let Some(v_some) = g() { v_some } else { continue };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:38:9
|
LL | let v = if let Some(v_some) = g() { v_some } else { break };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:42:5
|
LL | let v = if let Some(v_some) = g() { v_some } else { panic!() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:45:5
|
LL | / let v = if let Some(v_some) = g() {
LL | | v_some
LL | | } else {
LL | | std::process::abort()
LL | | };
| |______^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:52:5
|
LL | / let v = if let Some(v_some) = g() {
LL | | v_some
LL | | } else {
LL | | if true { return } else { panic!() }
LL | | };
| |______^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:59:5
|
LL | / let v = if let Some(v_some) = g() {
LL | | v_some
LL | | } else if true {
LL | | return;
LL | | } else {
LL | | panic!("diverge");
LL | | };
| |______^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:68:5
|
LL | / let v = if let Some(v_some) = g() {
LL | | v_some
LL | | } else {
LL | | match (g(), g()) {
... |
LL | | }
LL | | };
| |______^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:85:5
|
LL | / let (v, w) = if let Some(v_some) = g().map(|v| (v, 42)) {
LL | | v_some
LL | | } else {
LL | | return;
LL | | };
| |______^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:92:5
|
LL | / let v = if let (Some(v_some), w_some) = (g(), 0) {
LL | | (w_some, v_some)
LL | | } else {
LL | | return;
LL | | };
| |______^
error: this could be rewritten as `let else`
--> $DIR/manual_let_else.rs:101:13
|
LL | let $n = if let Some(v) = $e { v } else { return };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
LL | create_binding_if_some!(w, g());
| ------------------------------- in this macro invocation
|
= note: this error originates in the macro `create_binding_if_some` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to 13 previous errors