diff options
Diffstat (limited to 'tests/ui/async-await/issue-64391.rs')
-rw-r--r-- | tests/ui/async-await/issue-64391.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/async-await/issue-64391.rs b/tests/ui/async-await/issue-64391.rs new file mode 100644 index 000000000..c6faad3aa --- /dev/null +++ b/tests/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() { } |