summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/struct-literal-in-match-guard.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/parser/struct-literal-in-match-guard.rs')
-rw-r--r--tests/ui/parser/struct-literal-in-match-guard.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/ui/parser/struct-literal-in-match-guard.rs b/tests/ui/parser/struct-literal-in-match-guard.rs
index bf0551b5c..bbee60e28 100644
--- a/tests/ui/parser/struct-literal-in-match-guard.rs
+++ b/tests/ui/parser/struct-literal-in-match-guard.rs
@@ -3,6 +3,8 @@
// Unlike `if` condition, `match` guards accept struct literals.
// This is detected in <https://github.com/rust-lang/rust/pull/74566#issuecomment-663613705>.
+#![feature(if_let_guard)]
+
#[derive(PartialEq)]
struct Foo {
x: isize,
@@ -11,6 +13,7 @@ struct Foo {
fn foo(f: Foo) {
match () {
() if f == Foo { x: 42 } => {}
+ () if let Foo { x: 0.. } = Foo { x: 42 } => {}
_ => {}
}
}