Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 2 Packages Projects Releases Wiki Activity
Files
647f1536d2f50b203ca9a67396225c4f7771e1c8
rust/tests/coverage/async_block.rs

19 lines
347 B
Rust
Raw Normal View History

Revert "Auto merge of #130766 - clarfonthey:stable-coverage-attribute, r=wesleywiser" This reverts commit 1d35638dc38dbfbf1cc2a9823135dfcf3c650169, reversing changes made to f23a80a4c2fbca593b64e70f5970368824b4c5e9.
2024-12-22 14:26:54 +11:00
#![feature(coverage_attribute)]
[AUTO_GENERATED] Migrate compiletest to use `ui_test`-style `//@` directives
2024-02-22 12:10:29 +00:00
//@ edition: 2021
coverage: Add a test for `async` blocks We have coverage tests that use async functions, but none that use async blocks.
2023-12-19 22:17:10 +11:00
coverage: Extract `executor::block_on` from several async coverage tests By moving `block_on` to an auxiliary crate, we avoid having to keep a separate copy of it in every async test. (This also incorporates some small tweaks to the headers in `await_ready.rs`.)
2024-09-06 15:41:10 +10:00
//@ aux-build: executor.rs
extern crate executor;
coverage: Add a test for `async` blocks We have coverage tests that use async functions, but none that use async blocks.
2023-12-19 22:17:10 +11:00
fn main() {
for i in 0..16 {
let future = async {
if i >= 12 {
println!("big");
} else {
println!("small");
}
};
executor::block_on(future);
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 310ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API