Flush correctly
- Dominant language
- Rust
- Stars
- 38
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
When trying to `impl Drop for InnerOutput`, we quickly run into the issue of
```console
thread '' panicked at 'cannot access stdout during shutdown', src/libcore/option.rs:1008:5
```
since most usages of `Output` are in main. The trivial solution is to add `output.flush()?;` to your `fn main`, but that's not very ergonomic.
Contributor guide
Research direction
Start by locating InnerOutput, Output, and the fn main usage described in the issue, then reproduce the shutdown panic involving stdout. Check how Output is finalized and determine how flushing can happen without requiring each main function to call output.flush(). Done means Output shuts down without the panic while preserving its human- and machine-readable output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100