diff options
| author | Michael Goulet <michael@errs.io> | 2024-10-16 16:09:41 -0400 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-10-18 20:14:02 +1100 |
| commit | cdbf28af7694e0037d2ed8f78c40f60e5aef6de2 (patch) | |
| tree | fbe1b240f4a6386c71c9abcf8c443761b6c33f6e /tests/coverage/async_closure.coverage | |
| parent | e7c0d2750726c1f08b1de6956248ec78c4a97af6 (diff) | |
| download | rust-cdbf28af7694e0037d2ed8f78c40f60e5aef6de2.tar.gz rust-cdbf28af7694e0037d2ed8f78c40f60e5aef6de2.zip | |
Dont ICE when computing coverage of synthetic async closure body
Diffstat (limited to 'tests/coverage/async_closure.coverage')
| -rw-r--r-- | tests/coverage/async_closure.coverage | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/coverage/async_closure.coverage b/tests/coverage/async_closure.coverage new file mode 100644 index 00000000000..fd6edf7c29e --- /dev/null +++ b/tests/coverage/async_closure.coverage @@ -0,0 +1,24 @@ + LL| |#![feature(async_closure)] + LL| |//@ edition: 2021 + LL| | + LL| |//@ aux-build: executor.rs + LL| |extern crate executor; + LL| | + LL| 1|async fn call_once(f: impl async FnOnce()) { + LL| 1| f().await; + LL| 1|} + LL| | + LL| 1|pub fn main() { + LL| 2| let async_closure = async || {}; + ^1 + ------------------ + | async_closure::main::{closure#0}: + | LL| 1| let async_closure = async || {}; + ------------------ + | async_closure::main::{closure#0}::{closure#1}::<i32>: + | LL| 1| let async_closure = async || {}; + ------------------ + LL| 1| executor::block_on(async_closure()); + LL| 1| executor::block_on(call_once(async_closure)); + LL| 1|} + |
