mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-21 22:34:05 +00:00
Add regression test for issue #103476, fixed in edition 2024
This commit is contained in:
parent
427d9152d2
commit
f502dcea38
25
tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs
Normal file
25
tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs
Normal file
@ -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() {}
|
Loading…
Reference in New Issue
Block a user