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.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 000000000..0ab4f5ade
--- /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) => {}
+ _ => {}
+ }
+}