From b64d041c6543f5ce48ff356cc5aaf712224b70e4 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Thu, 11 Apr 2024 11:45:03 -0700 Subject: [PATCH] Move never_type test under issue266 --- tests/test.rs | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/tests/test.rs b/tests/test.rs index e868941..a42b225 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -252,25 +252,6 @@ pub async fn test_unimplemented() { let _ = <() as Trait>::f; } -#[cfg(async_trait_nightly_testing)] -pub async fn test_divering_function() { - #[async_trait] - pub trait Trait { - async fn f() -> !; - } - - #[async_trait] - impl Trait for () { - async fn f() -> ! { - loop { - std::thread::sleep(std::time::Duration::from_millis(1)); - } - } - } - - let _ = <() as Trait>::f; -} - // https://github.com/dtolnay/async-trait/issues/1 pub mod issue1 { use async_trait::async_trait; @@ -1641,3 +1622,23 @@ pub mod issue238 { async fn f() {} } } + +// https://github.com/dtolnay/async-trait/issues/266 +#[cfg(async_trait_nightly_testing)] +pub mod issue266 { + use async_trait::async_trait; + + #[async_trait] + pub trait Trait { + async fn f() -> !; + } + + #[async_trait] + impl Trait for () { + async fn f() -> ! { + loop { + std::thread::sleep(std::time::Duration::from_millis(1)); + } + } + } +}