Skip to content

Commit

Permalink
Add regression test for issue #103476, fixed in edition 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
est31 committed Nov 16, 2024
1 parent 427d915 commit f502dce
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// issue-103476
//@ compile-flags: -Zlint-mir -Zunstable-options
//@ 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() {}

0 comments on commit f502dce

Please sign in to comment.