Yikes this is a nasty rustc compiler bug that is in stable: https://github.com/rust-lang/rust/issues/64552#issuecomment-533267241
The sucky part is appears you can trigger it by consuming a normal async function. The actual code that needs to be fixed is not even in the diagnostic.
Lifetime bounds in auto trait impls prevent trait from being implemented on generators · Issue #64552 · rust-lang/rust
use std::collections::{BTreeMap, HashMap}; use std::sync::Arc; fn needs_send<T: Send>(_val: T) {} async fn async_fn_a(_num: u32) {} async fn async_fn_b(map: Arc<BTreeMap<u32, &'static u32>>) { for ...
