Uh oh!
There was an error while loading. Please reload this page.
Add a warning to File about mutability. - #48273
Conversation
rust-highfive
commented
Feb 16, 2018
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @joshtriplett (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. |
sfackler
commented
Feb 16, 2018
LGTM, but letting one of the docs folks r+. |
| /// Note that, although read and write methods require a `&mut File`, because | ||
| /// of the interfaces for [`Read`] and [`Write`], it is still possible to | ||
| /// modify a file through a `&File`, either through methods that take `&File` | ||
| /// or by retrieving a raw OS filehandle and modifying the file that way. |
There was a problem hiding this comment.
Or "underlying OS object", since on Linux it'd be a file descriptor.
joshtriplett
left a comment
There was a problem hiding this comment.
This looks great to me, and I'm glad to see these kinds of clarifying comments that help people understand the high-level semantics around what they're trying to do.
I posted one note about grammar, but otherwise I'd love to see this merged. Thanks!
| /// or by retrieving a raw OS filehandle and modifying the file that way. | ||
| /// Additionally, many operating systems allow concurrent modification of files | ||
| /// by different processes. Care should be taken not to assume that holding a | ||
| /// `&File` means that the file will not change. |
There was a problem hiding this comment.
This is a bit of a nitpick, but could you please phrase this in active voice?
"..., the holder of a &File can still modify that file, either through methods ..."
"... Avoid assuming that holding a &File means ..."
alercah
commented
Feb 17, 2018
Comments fixed. |
joshtriplett
commented
Feb 17, 2018
@bors r+ rollup |
bors
commented
Feb 17, 2018
@joshtriplett: 🔑 Insufficient privileges: not in try users |
bors
commented
Feb 17, 2018
@joshtriplett: 🔑 Insufficient privileges: Not in reviewers |
sfackler
commented
Feb 17, 2018
@bors r=joshtriplett rollup |
bors
commented
Feb 17, 2018
📌 Commit ec90597 has been approved by |
Add a warning to File about mutability. Fixesrust-lang#47708.
Add a warning to File about mutability. Fixesrust-lang#47708.
Fixes#47708.