la10736 / rstest

Fixture-based test framework for Rust
Apache License 2.0
1.21k stars 43 forks source link

#[awt] doesn't work if a test defines an inner function #189

Closed andrey-yantsen closed 1 year ago

andrey-yantsen commented 1 year ago

First of all, thank you for all the work! You have no idea how much my life has improved since I discovered rstest :)

The compilation of test below fails with error error[E0277]: can't compare '{integer}' with 'impl std::future::Future<Output = u8>':

#[rstest::fixture]
async fn fixture() -> u8 {
    0
}

#[rstest::rstest]
#[awt]
async fn bar(#[future] fixture: u8) {
    assert_eq!(0, fixture);

    fn baz() {}
}

If you remove the fn baz() {} inner funciton, everything works as expected.

la10736 commented 1 year ago

Sorry for late response .... I've missed it.

Really strange bug :smile: