mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
macros: add test for special return types (#7857)
This commit is contained in:
@@ -12,6 +12,9 @@ fn compile_fail_full() {
|
|||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
t.pass("tests/pass/macros_main_loop.rs");
|
t.pass("tests/pass/macros_main_loop.rs");
|
||||||
|
|
||||||
|
#[cfg(feature = "full")]
|
||||||
|
t.pass("tests/pass/impl_trait.rs");
|
||||||
|
|
||||||
#[cfg(feature = "full")]
|
#[cfg(feature = "full")]
|
||||||
t.compile_fail("tests/fail/macros_invalid_input.rs");
|
t.compile_fail("tests/fail/macros_invalid_input.rs");
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
use tests_build::tokio;
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn never() -> ! {
|
||||||
|
loop {}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn impl_trait() -> impl Iterator<Item = impl core::fmt::Debug> {
|
||||||
|
[()].into_iter()
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
if impl_trait().count() == 10 {
|
||||||
|
never();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user