about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2019-09-16 15:25:39 -0400
committerNiko Matsakis <niko@alum.mit.edu>2019-09-16 16:44:18 -0400
commit9ae1a664f7b947dadb9e97eea7703831d9cd5d31 (patch)
treedaf41c421d22b41b1bad8aabf50a40eafda511ab
parentab1a3f09fd3e1dbce850b9e1b691dc8338584e65 (diff)
downloadrust-9ae1a664f7b947dadb9e97eea7703831d9cd5d31.tar.gz
rust-9ae1a664f7b947dadb9e97eea7703831d9cd5d31.zip
add regression test for issue-64391
-rw-r--r--src/test/ui/async-await/issue-64391.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/ui/async-await/issue-64391.rs b/src/test/ui/async-await/issue-64391.rs
new file mode 100644
index 00000000000..c6faad3aad0
--- /dev/null
+++ b/src/test/ui/async-await/issue-64391.rs
@@ -0,0 +1,14 @@
+// Regression test for Issue #64391. The goal here is that this
+// function compiles. In the past, due to incorrect drop order for
+// temporaries in the tail expression, we failed to compile this
+// example. The drop order itself is directly tested in
+// `drop-order/drop-order-for-temporary-in-tail-return-expr.rs`.
+//
+// check-pass
+// edition:2018
+
+async fn add(x: u32, y: u32) -> u32 {
+    async { x + y }.await
+}
+
+fn main() { }