Add regression test of issue 186
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Currently fails to build without the fix: error: future cannot be shared between threads safely --> tests/test_macros.rs:64:5 | 64 | require_send_sync(async { | ^^^^^^^^^^^^^^^^^ future created by async block is not `Sync` | = help: within `impl Future`, the trait `Sync` is not implemented for `Cell<&str>` note: future is not `Sync` as this value is used across an await --> tests/test_macros.rs:65:9 | 65 | future::ready(anyhow!(message(Cell::new("...")))).await; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ first, await occurs here, with `Cell::new("...")` maybe used later... note: `Cell::new("...")` is later dropped here --> tests/test_macros.rs:65:64 | 65 | future::ready(anyhow!(message(Cell::new("...")))).await; | ---------------- ^ | | | has type `Cell<&str>` which is not `Sync` note: required by a bound in `require_send_sync` --> tests/test_macros.rs:50:41 | 50 | fn require_send_sync(_: impl Send + Sync) {} | ^^^^ required by this bound in `require_send_sync`
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+9 added−0 removed
- tests:+9 added−0 removed