summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/checked_unwrap/complex_conditionals_nested.rs
blob: 043ea4148dc517ed736dacd5c647f69d5c456fcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
#![allow(clippy::if_same_then_else, clippy::branches_sharing_code)]

fn test_nested() {
    fn nested() {
        let x = Some(());
        if x.is_some() {
            x.unwrap(); // unnecessary
        } else {
            x.unwrap(); // will panic
        }
    }
}

fn main() {}