Open krtab opened 1 year ago
We have some logic to detect recursive async functions here and give a more helpful error message...
We should expand the logic to cover this case as well.
(NOT A CONTRIBUTION)
It seems like the bigger issue here is not the confusing error message but that this should not trigger any error at all: rustc should not need to recursively typeck the future because the future is not stored in its own state.
Code
Current output
Desired output
I'm not sure what should be the proper error message. Because of the
tokio::spawn
this is not the same problem as in E0733.The workaround often proposed by @Darksonn on various forums is to use a wrapping non-async function:
Rationale and extra context
No response
Other cases
No response
Anything else?
No response