rust-doctor · Async
block-on-in-async
Flags `Runtime::block_on()` or `futures::executor::block_on()` called inside `async fn`. This blocks the current thread waiting for a future, which can deadlock the runtime if all worker threads are blocked.
- Severity
- error
- Confidence
- medium
- Analyzer
- syn-ast
- Default policy
- Enabled
Tags
Framework requirements
No framework requirement.
Limitations
- Syntactic analysis does not have rustc name resolution or inferred type information.
Remediation
Use `.await` instead of `block_on()`. If you need to call async code from sync context, restructure to avoid nesting runtimes.
Fix capability: guidance