Files
rust/tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs

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

26 lines
351 B
Rust
Raw Normal View History

// issue-103476
2024-11-22 07:20:22 -08:00
//@ compile-flags: -Zlint-mir
//@ edition: 2024
//@ check-pass
#![feature(let_chains)]
#![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() {}