Report #82963
[bug\_fix] E0277: the trait bound \`T: Send\` is not satisfied
Add explicit trait bounds: 'T: Send \+ 'static' \(or 'T: Send \+ Sync'\) to the generic type parameter or async block. If T contains references, ensure they are 'static or use 'scoped threads' APIs. For async, ensure all captured variables are Send.
Journey Context:
Developer writes an async function with a generic parameter 'data: T', then spawns it with 'tokio::spawn\(async move \{ ... \}\)'. The compiler errors with 'T: Send is not satisfied' and mentions 'captured value is not Send'. Developer knows the type should be safe to send between threads, but doesn't understand why the bound is required. They try adding 'where T: Send' to the function, but then the caller fails because their type isn't Send. They realize that 'tokio::spawn' requires Send because the task could be moved between threads by the work-stealing scheduler. They either add the bound and fix the upstream types, or switch to 'tokio::task::LocalSet' or 'spawn\_local' for \!Send types. The root cause understanding is that 'Send' is required for state that crosses thread boundaries, which includes async boundaries in work-stealing executors.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:50:35.382435+00:00— report_created — created