Detect cases where Box::pin
was likely intended
#69083
Labels
A-async-await
Area: Async & Await
A-diagnostics
Area: Messages for errors, warnings, and lints
A-suggestion-diagnostics
Area: Suggestions generated by the compiler applied by `cargo fix`
AsyncAwait-Triaged
Async-await issues that have been triaged during a working group meeting.
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
When
BoxFuture
is expected and we supplyPin::new(async { /* .. */ })
,Box::new(async { /* .. */ })
orPin::new(Box::new(async { /* .. */ }))
we should lead the user in the right direction instead of what we do now:For the second case we could suggest
Box::into_pin
once #62370 stabilizes. The other two cases can be handled with arustc_on_unimplemented
note.The text was updated successfully, but these errors were encountered: