Skip to content

Add warning to BufWriter documentation - #43136

Merged
bors merged 1 commit into
rust-lang:masterfrom
gllghr:bufWriterDocs
Jul 12, 2017
Merged

Add warning to BufWriter documentation#43136
bors merged 1 commit into
rust-lang:masterfrom
gllghr:bufWriterDocs

Conversation

@gllghr

Copy link
Copy Markdown

When using BufWriter, it is very easy to unintentionally ignore errors, because errors which occur when flushing buffered data when the BufWriter is dropped are ignored. This has been noted in a couple places: #32677, #37045.

There has been some discussion about how to fix this problem in #32677, but no solution seems likely to land in the near future. For now, anyone who wishes to have robust error handling must remember to manually call flush() on a BufWriter before it is dropped. Until a permanent fix is in place, it seems worthwhile to add a warning to that effect to the documentation.

@rust-highfive

Copy link
Copy Markdown
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BurntSushi (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@frewsxcvfrewsxcv added A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools T-libs-api [DEPRECATED; DO NOT USE] S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 10, 2017
@BurntSushi

Copy link
Copy Markdown
Member

Adding this warning seems sensible enough to me. I think the only question is whether this now makes the behavior part of the public API, and if so, whether we're comfortable with that or not. I kind of feel like it's already the de facto API, so these docs are just recognizing that.

Anyone else from @rust-lang/libs want to weigh in?

@alexcrichton

Copy link
Copy Markdown
Member

Seems like a fine change to me!

@steveklabnik

Copy link
Copy Markdown
Contributor

@bors: r+ rollup

thank you!

@bors

bors commented Jul 10, 2017

Copy link
Copy Markdown
Collaborator

📌 Commit c6b280e has been approved by steveklabnik

@arielb1arielb1 added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 11, 2017
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jul 12, 2017
…bnik
Add warning to BufWriter documentation
When using `BufWriter`, it is very easy to unintentionally ignore errors, because errors which occur when flushing buffered data when the `BufWriter` is dropped are ignored. This has been noted in a couple places: rust-lang#32677, rust-lang#37045.
There has been some discussion about how to fix this problem in rust-lang#32677, but no solution seems likely to land in the near future. For now, anyone who wishes to have robust error handling must remember to manually call `flush()` on a `BufWriter` before it is dropped. Until a permanent fix is in place, it seems worthwhile to add a warning to that effect to the documentation.
bors added a commit that referenced this pull request Jul 12, 2017
Rollup of 8 pull requests
- Successful merges: #42670, #42826, #43000, #43011, #43098, #43100, #43136, #43137
- Failed merges:
@bors
bors merged commit c6b280e into rust-lang:masterJul 12, 2017
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libs-api[DEPRECATED; DO NOT USE]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants

@gllghr@rust-highfive@BurntSushi@alexcrichton@steveklabnik@bors@dtolnay@frewsxcv@arielb1