mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 10:45:18 +00:00
19 lines
371 B
Rust
19 lines
371 B
Rust
// 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() {}
|