-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Properly handle mutability for awaited futures (#239)
* Properly handle mutability for awaited futures * Simplify and add tests * Implement review
- Loading branch information
Showing
6 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
use rstest::*; | ||
|
||
#[rstest] | ||
#[case::pass(async { 3 })] | ||
#[awt] | ||
async fn my_mut_test_global_awt( | ||
#[future] | ||
#[case] | ||
mut a: i32, | ||
) { | ||
a = 4; | ||
assert_eq!(a, 4); | ||
} | ||
|
||
#[rstest] | ||
#[case::pass(async { 3 })] | ||
async fn my_mut_test_local_awt( | ||
#[future(awt)] | ||
#[case] | ||
mut a: i32, | ||
) { | ||
a = 4; | ||
assert_eq!(a, 4); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters