Clarify shared file handler behavior of File::try_clone.#47958
Clarify shared file handler behavior of File::try_clone.#47958bors merged 1 commit intorust-lang:masterfrom
Conversation
|
r? @aidanhs (rust_highfive has picked a reviewer for you, use r? to override) |
2f2bfd0 to
687c30a
Compare
src/libstd/fs.rs
Outdated
There was a problem hiding this comment.
not a big fan of my wording here or in the previous section. lemme know if y'all have better suggestions
There was a problem hiding this comment.
Maybe something along the lines of:
This means that both
Fileinstance shares the same cursor; reads, writes and seeks will affect both instances simultaneously.
There was a problem hiding this comment.
Thanks for the suggestion! Latest force push incorporates some of that wording
|
I just realized this could be a bad footgun for someone using a cloned handle with |
687c30a to
d597da3
Compare
@abonander I think that might be a good idea. Any suggestions on how to word this? |
|
Something like Note:
|
|
We already have a warning about a similar footgun with |
|
Okay so it sounds like we might want to open a separate issue for that then? What do you think? |
|
@bors r+ rollup This looks good to me, and it sounds like the bufreader thing may need more discussion elsewhere. |
|
📌 Commit d597da3 has been approved by |
|
💡 This pull request was already approved, no need to approve it again.
|
|
📌 Commit d597da3 has been approved by |
Clarify shared file handler behavior of File::try_clone. Fixes rust-lang#46578.
Clarify shared file handler behavior of File::try_clone. Fixes rust-lang#46578.
Clarify shared file handler behavior of File::try_clone. Fixes rust-lang#46578.
Fixes #46578.