macros: add test for special return types (#7857)

This commit is contained in:
Alice Ryhl
2026-01-15 10:25:45 +01:00
committed by GitHub
parent 1280cf81de
commit 11f9d4db73
2 changed files with 20 additions and 0 deletions
+3
View File
@@ -12,6 +12,9 @@ fn compile_fail_full() {
#[cfg(feature = "full")]
t.pass("tests/pass/macros_main_loop.rs");
#[cfg(feature = "full")]
t.pass("tests/pass/impl_trait.rs");
#[cfg(feature = "full")]
t.compile_fail("tests/fail/macros_invalid_input.rs");
+17
View File
@@ -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();
}
}