Skip to content

stdout is not as buffered as it could be in some cases #10279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alexcrichton opened this issue Nov 5, 2013 · 2 comments
Closed

stdout is not as buffered as it could be in some cases #10279

alexcrichton opened this issue Nov 5, 2013 · 2 comments

Comments

@alexcrichton
Copy link
Member

As part of #10270 I removed the page buffering schemed of a piped stdout in favor of a line buffering scheme. We will always want a line-buffering stdout at most for prints to a terminal, but when stdout is piped elsewhere we would ideally like to buffer more than just one line.

The reasoning for changing this is that diagnosing a runaway rust process becomes much more difficult with a buffered stdout. Most programmers are expecting some sort of line buffer, but very few consider flushing stdout after all of their lines have been printed as well. As a result, a program killed by a signal currently doesn't flush stdout, meaning that all of that output is lost. This output is likely very important for diagnosing why the process went awry in the first place.

I would like to turn this buffering back on, but not until we have a good solution for this fairly common case.

@steveklabnik
Copy link
Member

With IO reform looming, I'm not sure what the status is of this today.

@alexcrichton alexcrichton added A-io and removed A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows labels Aug 17, 2015
@steveklabnik
Copy link
Member

With no comments since my original one, I'm just going to close this. If anyone thinks it's still valid, please open a new issue with details, thanks!

flip1995 pushed a commit to flip1995/rust that referenced this issue Apr 3, 2025
…4381)

When lowering a destructuring assignment from AST to HIR, the compiler
will reuse the same identifier name (namely `sym::lhs`) for all the
fields. The desugaring must be checked for to avoid a false positive of
the `shadow_unrelated` lint.

Fix rust-lang#10279
Fix rust-lang#14377

changelog: [`shadow_unrelated`]: prevent false positive in destructuring
assignments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants