summaryrefslogtreecommitdiffstats
path: root/tests/ui/match/issue-84434.rs
blob: 423481fd5f02d0f461fb4ac41dcedafbd12793d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// https://github.com/rust-lang/rust/issues/84434
// check-pass

use std::path::Path;
struct A {
    pub func: fn(check: bool, a: &Path, b: Option<&Path>),
}
const MY_A: A = A {
    func: |check, a, b| {
        if check {
            let _ = ();
        } else if let Some(parent) = b.and_then(|p| p.parent()) {
            let _ = ();
        }
    },
};

fn main() {}