Skip to content

Documentation for stdout does not mention flushing #74348

Closed

Description

@Lonami

From rust-dc/fish-manpage-completions#96 (comment).

The documentation for std::io::stdout() does not mention "flush" anywhere, neither does Stdout or StdoutLock. I think it would be helpful for the documentation to indicate the behaviour, i.e. if it should be flushed manually or it's flushed once it goes out of scope.

The same would apply for stderr. I'm not sure if the behaviour of #23205 has changed since, or whether not documenting flushing was an oversight or intended to allow breakage in that regard.

Activity

  1. added
    C-enhancementCategory: An issue proposing an enhancement or a PR with one.
    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
    T-libs-api[DEPRECATED; DO NOT USE]
    on Jul 15, 2020
  2. hkBst commented on Feb 5, 2025

    @hkBst
    Member

    A buffered output stream collects output into a buffer before sending it on to the real output, which ultimately happens via a call to the kernel. It prevents the inefficiency of a kernel call for each character, but has the added complexity of needing to output the contents of its buffer to the real output. This is called flushing the buffer. Output that gets added to the buffer but not flushed will not really be output and will not be seen on the screen or written to disk as the case may be.

    No other knowledge seems necessary, so

    @rustbot label E-easy

  3. added
    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
    on Feb 5, 2025
  4. pcorwin commented on Feb 10, 2025

    @pcorwin
    Contributor

    @rustbot claim

  5. added a commit that references this issue on Mar 4, 2025
  6. added a commit that references this issue on Mar 5, 2025
  7. added a commit that references this issue on Mar 5, 2025
  8. added a commit that references this issue on Mar 5, 2025
  9. added a commit that references this issue on Mar 5, 2025
  10. added a commit that references this issue on Mar 5, 2025
  11. added a commit that references this issue on Mar 5, 2025
  12. added a commit that references this issue on Mar 5, 2025
  13. added a commit that references this issue on Mar 5, 2025
  14. added a commit that references this issue on Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.T-libs-api[DEPRECATED; DO NOT USE]

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions