summaryrefslogtreecommitdiffstats
path: root/tests/ui/let-else/let-else-irrefutable.rs
blob: f4b338eb0af95313b64b760ecf35175cfe9bc807 (plain)
1
2
3
4
5
6
7
8
9
10
11
// check-pass

fn main() {
    let x = 1 else { return }; //~ WARN irrefutable `let...else` pattern

    // Multiline else blocks should not get printed
    let x = 1 else { //~ WARN irrefutable `let...else` pattern
        eprintln!("problem case encountered");
        return
    };
}