mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-02 10:18:25 +00:00
25 lines
331 B
Rust
25 lines
331 B
Rust
// issue-103476
|
|
//@ compile-flags: -Zlint-mir
|
|
//@ edition: 2024
|
|
//@ check-pass
|
|
|
|
#![allow(irrefutable_let_patterns)]
|
|
|
|
struct Pd;
|
|
|
|
impl Pd {
|
|
fn it(&self) -> It<'_> {
|
|
todo!()
|
|
}
|
|
}
|
|
|
|
pub struct It<'a>(Box<dyn Tr<'a>>);
|
|
|
|
trait Tr<'a> {}
|
|
|
|
fn f(m: Option<Pd>) {
|
|
if let Some(n) = m && let it = n.it() {};
|
|
}
|
|
|
|
fn main() {}
|