Panic when piping --check to head
Open
Nobody has claimed this yet.
A-io
C-bug
P-low
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 24
Description
rustfmt 0.99.2-nightly (5c9a2b6 2018-08-07)
└─ env RUST_BACKTRACE=1 cargo +nightly fmt -- --check | head
Diff in /home/yalter/Source/rust/yalter-bot/src/bot.rs at line 21:
pub fn new(discord: Discord, modules: Vec<Box<Module>>) -> Self {
// Connect.
let (connection, ready) = discord.connect().expect("Connect failed");
- println!(
- "[Ready] {} is serving {} servers.",
- ready.user.username,
- ready.servers.len()
- );
+ println!("[Ready] {} is serving {} servers.",
thread 'main' panicked at 'failed printing to stdout: Broken pipe (os error 32)', libstd/io/stdio.rs:696:9
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::print
at libstd/sys_common/backtrace.rs:71
at libstd/sys_common/backtrace.rs:59
2: std::panicking::default_hook::{{closure}}
at libstd/panicking.rs:211
3: std::panicking::default_hook
at libstd/panicking.rs:227
4: std::panicking::rust_panic_with_hook
at libstd/panicking.rs:475
5: std::panicking::continue_panic_fmt
at libstd/panicking.rs:390
6: std::panicking::begin_panic_fmt
at libstd/panicking.rs:345
7: std::io::stdio::_print
at libstd/io/stdio.rs:696
at libstd/io/stdio.rs:705
8: rustfmt_nightly::rustfmt_diff::OutputWriter::writeln
9: rustfmt_nightly::filemap::write_file
10: <rustfmt_nightly::Session<'b, T> as rustfmt_nightly::formatting::FormatHandler>::handle_formatted_file
11: rustfmt_nightly::formatting::format_project
12: syntax::with_globals
13: <rustfmt_nightly::Session<'b, T>>::format
14: rustfmt::format_and_emit_report
15: <rustfmt_nightly::Session<'b, T>>::override_config
16: rustfmt::execute
17: rustfmt::main
18: std::rt::lang_start::{{closure}}
19: std::panicking::try::do_call
at libstd/rt.rs:59
at libstd/panicking.rs:310
20: __rust_maybe_catch_panic
at libpanic_unwind/lib.rs:105
21: std::rt::lang_start_internal
at libstd/panicking.rs:289
at libstd/panic.rs:392
at libstd/rt.rs:58
22: main
23: __libc_start_main
24: <unknown>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the rustfmt_diff::OutputWriter::writeln stack-frame entry and follow its use from filemap::write_file during cargo +nightly fmt -- --check | head. Reproduce the command with the reported nightly version and confirm that piping output to head no longer causes a broken-pipe panic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100