Add a note for ? on a impl Future<Output = Result<..>> in sync function by compiler-errors · Pull Request #131549 · rust-lang/rust (original) (raw)

It's confusing to ? a future of a result in a sync function. We have a suggestion to .await it if we're in an async function, but not a sync function. Note that this is the case for sync functions, at least.

Let's be a bit more vague about a fix, since it's somewhat context dependent. For example, you could block on it, or you could make your function asynchronous. 🤷