about summary refs log tree commit diff
path: root/tests/ui/or-patterns/mismatched-bindings-async-fn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/or-patterns/mismatched-bindings-async-fn.rs')
-rw-r--r--tests/ui/or-patterns/mismatched-bindings-async-fn.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/or-patterns/mismatched-bindings-async-fn.rs b/tests/ui/or-patterns/mismatched-bindings-async-fn.rs
new file mode 100644
index 00000000000..d1cb73aafa0
--- /dev/null
+++ b/tests/ui/or-patterns/mismatched-bindings-async-fn.rs
@@ -0,0 +1,14 @@
+// Regression test for #71297
+// edition:2018
+
+async fn a((x | s): String) {}
+//~^ ERROR variable `x` is not bound in all patterns
+//~| ERROR variable `s` is not bound in all patterns
+
+async fn b() {
+    let (x | s) = String::new();
+    //~^ ERROR variable `x` is not bound in all patterns
+    //~| ERROR variable `s` is not bound in all patterns
+}
+
+fn main() {}