Skip to content

Commit

Permalink
Move never_type test under issue266
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 11, 2024
1 parent b683da8 commit b64d041
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));
}
}
}
}

0 comments on commit b64d041

Please sign in to comment.