summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/missed-capture-issue-107414.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/async-await/missed-capture-issue-107414.rs')
-rw-r--r--tests/ui/async-await/missed-capture-issue-107414.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/async-await/missed-capture-issue-107414.rs b/tests/ui/async-await/missed-capture-issue-107414.rs
index 0ab4f5ade..bb14eb74b 100644
--- a/tests/ui/async-await/missed-capture-issue-107414.rs
+++ b/tests/ui/async-await/missed-capture-issue-107414.rs
@@ -1,6 +1,8 @@
// check-pass
// edition:2018
+#![feature(if_let_guard)]
+
fn main() {}
struct StructA {}
@@ -22,3 +24,10 @@ async fn ice() {
_ => {}
}
}
+
+async fn if_let() {
+ match Some(StructB {}) {
+ Some(struct_b) if let true = get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {}
+ _ => {}
+ }
+}