I expected to see this happen: Code compiles successfully
Instead, this happened: Compile error:
error: implementation of `AsyncFnOnce` is not general enough
--> src/lib.rs:13:5
|
13 | / assert_send(async {
14 | | commit_if_ok(&mut ctxt, async |_| todo!()).await;
15 | | });
| |______^ implementation of `AsyncFnOnce` is not general enough
|
= note: `{async closure@src/lib.rs:14:33: 14:42}` must implement `AsyncFnOnce<(&mut Ctxt<'1>,)>`, for any two lifetimes `'0` and `'1`...
= note: ...but it actually implements `AsyncFnOnce<(&mut Ctxt<'_>,)>`
error: could not compile `playground` (lib) due to 1 previous error
I'm not sure if this is really a bug (or perhaps a duplicate issue of another bug). However, I can't see any reason why this shouldn't work.
I tried this code:
I expected to see this happen: Code compiles successfully
Instead, this happened: Compile error:
(see https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=536db823e50d32307ee54645dbec25c6)
Meta
rustc --version --verbose
: