rust/tests/ui/match/issue-84434.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
371 B
Rust
Raw Normal View History

2021-04-23 18:06:02 +00:00
// 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() {}