Skip to content

Commit

Permalink
Enable tests for async fn in traits (#839)
Browse files Browse the repository at this point in the history
Co-authored-by: jw013 <890943+jw013@users.noreply.github.com>
  • Loading branch information
jw013 and jw013 authored Jul 27, 2024
1 parent 6173c4f commit b2d4458
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
13 changes: 5 additions & 8 deletions test_crates/async_impl_future_equivalence/new/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ impl S {
pub async fn switches_to_async() {}
}

// TODO: https://github.com/obi1kenobi/cargo-semver-checks/issues/624
// Uncomment once the project drops support for Rust < 1.75
//
// #[allow(async_fn_in_trait)]
// pub trait Trait {
// fn switches_to_return_impl() -> impl Future;
// async fn switches_to_async();
// }
#[allow(async_fn_in_trait)]
pub trait Trait {
fn switches_to_return_impl() -> impl Future;
async fn switches_to_async();
}
13 changes: 5 additions & 8 deletions test_crates/async_impl_future_equivalence/old/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,8 @@ impl S {
}
}

// TODO: https://github.com/obi1kenobi/cargo-semver-checks/issues/624
// Uncomment once the project drops support for Rust < 1.75
//
// #[allow(async_fn_in_trait)]
// pub trait Trait {
// async fn switches_to_return_impl();
// fn switches_to_async() -> impl Future;
// }
#[allow(async_fn_in_trait)]
pub trait Trait {
async fn switches_to_return_impl();
fn switches_to_async() -> impl Future;
}

0 comments on commit b2d4458

Please # to comment.