struct X(Option<()>, Option<()>);
let x: Option<Result<X, ()>>;

match x {
    Some(Ok(a)) if let Some(b) = a.0 && let Some(b) = a.1 => "many somes",
    Some(Err(a)) => "some",
    None => "none"
}
let tmp_x = x;
match tmp_x {
    Some(Ok(a)) => {
        if let Some(b) = a.0 && let Some(b) = a.1 {
            "many somes"
        } else {
            contuneu;
        }
    }
}
if let Some(b) = a.0 && let Some(b) = a.1 {}
else if ... {}
else {}

|
v

match () {
    () if let Some(b) = a.0 && let Some(b) = a.1 => {},
    () if ... => {},
    () => {}
}

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b20e5d2285acaeea05f25b3bb863de93
https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=c9a090bd95079e1c3991fc6696ad0ba2

#![feature(if_let_guard)]
struct S(u8);

impl Drop for S {
    fn drop(&mut self) {
        println!("{}", self.0);
    }
}

impl S {
    fn t(&self) -> bool {
        true
    }

    fn f(&self) -> bool {
        false
    }
}

fn main() {
    println!("A");
    if let true = S(0).f() {
        println!("B");
    } else if let true = S(1).t() {
        println!("C");
    } else {
        println!("D");
    }
    
    // AB0CD

    println!("-----");

    println!("A");
    match () {
        () if let true = S(0).f() => {
            println!("B");
        }
        () if let true = S(1).t() => {
            println!("C");
        }
        () => {
            println!("D");
        }
    }
    
    // A0C1
}

https://github.com/rust-lang/rust/issues/51114#issuecomment-980466680

Select a repo