You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks like our version of rust-lang/rust#64856. I expect the same fix will work.
use anyhow::anyhow;use std::future;fnassert_sync<T:Sync>(_:T){}fnmain(){assert_sync(async{
future::ready(anyhow!("...")).await;});}
This is fine with the current most recent published version of anyhow (1.0.45) but on master due to #180 it fails as follows:
error: future cannot be shared between threads safely --> src/main.rs:7:5 |7 | assert_sync(async { | ^^^^^^^^^^^ future created by async block is not `Sync` | = help: within `impl Future`, the trait `Sync` is not implemented for `core::fmt::Opaque`note: future is not `Sync` as this value is used across an await --> src/main.rs:8:9 |8 | future::ready(anyhow!("...")).await; | ^^^^^^^^^^^^^^--------------^^^^^^^- `$crate::private::format_args!($msg)` is later dropped here | | | | | has type `[ArgumentV1<'_>; 0]` which is not `Sync` | await occurs here, with `$crate::private::format_args!($msg)` maybe used laternote: required by a bound in `assert_sync` --> src/main.rs:4:19 |4 | fn assert_sync<T: Sync>(_: T) {} | ^^^^ required by this bound in `assert_sync`
The text was updated successfully, but these errors were encountered:
This looks like our version of rust-lang/rust#64856. I expect the same fix will work.
This is fine with the current most recent published version of
anyhow
(1.0.45) but on master due to #180 it fails as follows:The text was updated successfully, but these errors were encountered: