error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:29:5
   |
LL |     let v = if let Some(v_some) = g() { v_some } else { return };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Some(v) = g() else { return };`
   |
   = note: `-D clippy::manual-let-else` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::manual_let_else)]`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:32:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
LL | |     } else {
LL | |         return;
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         return;
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:40:5
   |
LL | /     let v = if let Some(v) = g() {
...  |
LL | |         return;
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         // Some computation should still make it fire
LL +         g();
LL +         return;
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:53:9
   |
LL |         let v = if let Some(v_some) = g() { v_some } else { continue };
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Some(v) = g() else { continue };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:56:9
   |
LL |         let v = if let Some(v_some) = g() { v_some } else { break };
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Some(v) = g() else { break };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:61:5
   |
LL |     let v = if let Some(v_some) = g() { v_some } else { panic!() };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Some(v) = g() else { panic!() };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:65:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
LL | |     } else {
LL | |         std::process::abort()
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         std::process::abort()
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:74:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
LL | |     } else {
LL | |         if true { return } else { panic!() }
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         if true { return } else { panic!() }
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:83:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
...  |
LL | |         panic!();
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         if true {}
LL +         panic!();
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:93:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
...  |
LL | |         ()
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         panic!();
LL +         ()
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:103:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
...  |
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         panic!();
LL +         if true {
LL +             match 0 {
LL +                 0 => (),
LL +                 _ => (),
LL +             }
LL +         } else {
LL +             panic!()
LL +         }
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:120:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
...  |
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         loop {
LL +             panic!();
LL +             break ();
LL +         }
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:132:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
...  |
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         'a: loop {
LL +             panic!();
LL +             loop {
LL +                 match 0 {
LL +                     0 if (return break 'a ()) => {},
LL +                     _ => {},
LL +                 }
LL +             }
LL +         }
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:149:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
...  |
LL | |         };
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         match 0 {
LL +             0 if true => panic!(),
LL +             _ => panic!(),
LL +         };
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:161:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
LL | |     } else {
LL | |         if panic!() {};
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         if panic!() {};
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:170:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
...  |
LL | |         };
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         match panic!() {
LL +             _ => {},
LL +         };
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:181:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
...  |
LL | |         panic!("diverge");
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else { if true {
LL +         return;
LL +     } else {
LL +         panic!("diverge");
LL +     } };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:192:5
   |
LL | /     let v = if let Some(v_some) = g() {
LL | |
LL | |
LL | |         v_some
...  |
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(v) = g() else {
LL +         match (g(), g()) {
LL +             (Some(_), None) => return,
LL +             (None, Some(_)) => {
LL +                 if true {
LL +                     return;
LL +                 } else {
LL +                     panic!();
LL +                 }
LL +             },
LL +             _ => return,
LL +         }
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:211:5
   |
LL | /     let (v, w) = if let Some(v_some) = g().map(|v| (v, 42)) {
LL | |
LL | |
LL | |         v_some
LL | |     } else {
LL | |         return;
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some((v, w)) = g().map(|v| (v, 42)) else {
LL +         return;
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:220:5
   |
LL | /     let (w, S { v }) = if let (Some(v_some), w_some) = (g().map(|_| S { v: 0 }), 0) {
LL | |
LL | |
LL | |         (w_some, v_some)
LL | |     } else {
LL | |         return;
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let (Some(S { v }), w) = (g().map(|_| S { v: 0 }), 0) else {
LL +         return;
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:231:13
   |
LL |             let $n = if let Some(v) = $e { v } else { return };
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Some($n) = g() 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: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:241:5
   |
LL |     let v = if let Variant::A(a, 0) = e() { a } else { return };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Variant::A(v, 0) = e() else { return };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:245:5
   |
LL |     let mut v = if let Variant::B(b) = e() { b } else { return };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Variant::B(mut v) = e() else { return };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:250:5
   |
LL | /     let v = if let Ok(Some(Variant::B(b))) | Err(Some(Variant::A(b, _))) = nested {
LL | |
LL | |
LL | |         b
LL | |     } else {
LL | |         return;
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let (Ok(Some(Variant::B(v))) | Err(Some(Variant::A(v, _)))) = nested else {
LL +         return;
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:258:5
   |
LL |     let v = if let Variant::A(.., a) = e() { a } else { return };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Variant::A(.., v) = e() else { return };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:262:5
   |
LL |     let w = if let (Some(v), ()) = (g(), ()) { v } else { return };
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let (Some(w), ()) = (g(), ()) else { return };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:266:5
   |
LL | /     let w = if let Some(S { v: x }) = Some(S { v: 0 }) {
LL | |
LL | |
LL | |         x
LL | |     } else {
LL | |         return;
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(S { v: w }) = Some(S { v: 0 }) else {
LL +         return;
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:275:5
   |
LL | /     let v = if let Some(S { v: x }) = Some(S { v: 0 }) {
LL | |
LL | |
LL | |         x
LL | |     } else {
LL | |         return;
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(S { v }) = Some(S { v: 0 }) else {
LL +         return;
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:284:5
   |
LL | /     let (x, S { v }, w) = if let Some(U { v, w, x }) = None::<U<S<()>>> {
LL | |
LL | |
LL | |         (x, v, w)
LL | |     } else {
LL | |         return;
LL | |     };
   | |______^
   |
help: consider writing
   |
LL ~     let Some(U { v: S { v }, w, x }) = None::<U<S<()>>> else {
LL +         return;
LL +     };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:402:5
   |
LL | /     let _ = match ff {
LL | |
LL | |         Some(value) => value,
LL | |         _ => macro_call!(),
LL | |     };
   | |______^ help: consider writing: `let Some(_) = ff else { macro_call!() };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:479:9
   |
LL |         let v = if let Some(v_some) = g() { v_some } else { return };
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `let Some(v) = g() else { return };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:491:9
   |
LL | /         let signature = match value {
LL | |
LL | |             Foo::Str(ref val) => val,
LL | |             _ => {
...  |
LL | |             },
LL | |         };
   | |__________^
   |
help: consider writing
   |
LL ~         let Foo::Str(ref signature) = value else {
LL +                 println!("No signature found");
LL +                 return;
LL +             };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:507:9
   |
LL | /         let signature = match value {
LL | |
LL | |             Bar::Str { ref mut inner } => inner,
LL | |             _ => {
...  |
LL | |             },
LL | |         };
   | |__________^
   |
help: consider writing
   |
LL ~         let Bar::Str { inner: ref mut signature } = value else {
LL +                 println!("No signature found");
LL +                 return;
LL +             };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:520:9
   |
LL | /         let value = match foo() {
LL | |
LL | |             Err(_) => return Err("abc"),
LL | |             Ok(value) => value,
LL | |         };
   | |__________^ help: consider writing: `let Ok(value) = foo() else { return Err("abc") };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:527:9
   |
LL | /         let v = match w {
LL | |
LL | |             None => return Err("abc"),
LL | |             Some(x) => x,
LL | |         };
   | |__________^ help: consider writing: `let Some(v) = w else { return Err("abc") };`

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:557:9
   |
LL | /         let value = if let Some(value) = unsafe { something_unsafe() } {
LL | |
LL | |             value
LL | |         } else {
LL | |             return;
LL | |         };
   | |__________^
   |
help: consider writing
   |
LL ~         let Some(value) = (unsafe { something_unsafe() }) else {
LL +             return;
LL +         };
   |

error: this could be rewritten as `let...else`
  --> tests/ui/manual_let_else.rs:566:9
   |
LL | /         let value = if let Some(value) = if some_flag { None } else { Some(3) } {
LL | |
LL | |             value
LL | |         } else {
LL | |             return;
LL | |         };
   | |__________^
   |
help: consider writing
   |
LL ~         let Some(value) = (if some_flag { None } else { Some(3) }) else {
LL +             return;
LL +         };
   |

error: aborting due to 37 previous errors

