about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tests/ui/async-await/missed-capture-issue-107414.rs24
1 files changed, 24 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
new file mode 100644
index 00000000000..0ab4f5ade98
--- /dev/null
+++ b/tests/ui/async-await/missed-capture-issue-107414.rs
@@ -0,0 +1,24 @@
+// check-pass
+// edition:2018
+
+fn main() {}
+
+struct StructA {}
+struct StructB {}
+
+impl StructA {
+    fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
+        true
+    }
+}
+
+async fn get_struct_a_async() -> StructA {
+    StructA {}
+}
+
+async fn ice() {
+    match Some(StructB {}) {
+        Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {}
+        _ => {}
+    }
+}