Skip to content

Commit 7b45c59

Browse files
committed
Add match guard chains test for absence of compilation error
based on tests/ui/rfcs/rfc-2497-if-let-chains/temporary-early-drop.rs
1 parent 5c2677d commit 7b45c59

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// issue-103476
2+
//@ revisions: edition2021 edition2024
3+
//@ [edition2021] edition: 2021
4+
//@ [edition2024] edition: 2024
5+
//@ check-pass
6+
7+
#![feature(if_let_guard)]
8+
#![allow(irrefutable_let_patterns)]
9+
10+
struct Pd;
11+
12+
impl Pd {
13+
fn it(&self) -> It {
14+
todo!()
15+
}
16+
}
17+
18+
pub struct It<'a>(Box<dyn Tr<'a>>);
19+
20+
trait Tr<'a> {}
21+
22+
fn f(m: Option<Pd>) {
23+
match () {
24+
() if let Some(n) = m && let it = n.it() => {}
25+
_ => {}
26+
}
27+
}
28+
29+
fn main() {}

0 commit comments

Comments
 (0)