mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
22 lines
412 B
Rust
22 lines
412 B
Rust
//@ known-bug: rust-lang/rust#126680
|
|
//@ compile-flags: -Zvalidate-mir
|
|
#![feature(type_alias_impl_trait)]
|
|
type Bar = impl std::fmt::Display;
|
|
|
|
use std::path::Path;
|
|
|
|
struct A {
|
|
pub func: fn(check: Bar, b: Option<&Path>),
|
|
}
|
|
const MY_A: A = A {
|
|
func: |check, b| {
|
|
if check {
|
|
()
|
|
} else if let Some(_) = b.and_then(|p| p.parent()) {
|
|
()
|
|
}
|
|
},
|
|
};
|
|
|
|
fn main() {}
|