Stabilize Path::try_exists() and improve doc#97912
Conversation
|
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
|
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
|
@rustbot label +T-libs-api -T-libs |
|
@rfcbot merge |
|
Team member @m-ou-se has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
cd374ae to
9f97ad9
Compare
This comment has been minimized.
This comment has been minimized.
9f97ad9 to
dfd0b80
Compare
|
Hmm:
I don't understand this. |
|
Looks like you changed metadata of file, like rust/src/tools/tidy/src/bins.rs Lines 37 to 39 in be16c61 Yes, you can see file permissions change in |
dfd0b80 to
1651b55
Compare
|
@klensy thanks! (I have a vim script that sets executable bit for files beginning with |
This comment has been minimized.
This comment has been minimized.
|
🔔 This is now entering its final comment period, as per the review above. 🔔 |
1651b55 to
83a0313
Compare
83a0313 to
9363939
Compare
|
☔ The latest upstream changes (presumably #98091) made this pull request unmergeable. Please resolve the merge conflicts. |
This stabilizes the `Path::try_exists()` method which returns `Result<bool, io::Error>` instead of `bool` allowing handling of errors unrelated to the file not existing. (e.g permission errors) Along with the stabilization it also: * Warns that the `exists()` method is error-prone and suggests to use the newly stabilized one. * Suggests it instead of `metadata()` to handle errors. * Mentions TOCTOU bugs to avoid false assumption that `try_exists()` is completely safe fixed version of `exists()`. * Renames the feature of still-unstable `std::fs::try_exists()` to `fs_try_exists` to avoid name conflict. The tracking issue rust-lang#83186 remains open to track `fs_try_exists`.
9363939 to
5608707
Compare
|
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. This will be merged soon. |
|
@bors r+ |
|
📌 Commit 5608707 has been approved by |
…r=dtolnay Stabilize `Path::try_exists()` and improve doc This stabilizes the `Path::try_exists()` method which returns `Result<bool, io::Error>` instead of `bool` allowing handling of errors unrelated to the file not existing. (e.g permission errors) Along with the stabilization it also: * Warns that the `exists()` method is error-prone and suggests to use the newly stabilized one. * Suggests it instead of `metadata()` to handle errors. * Mentions TOCTOU bugs to avoid false assumption that `try_exists()` is completely safe fixed version of `exists()`. * Renames the feature of still-unstable `std::fs::try_exists()` to `fs_try_exists` to avoid name conflict. The tracking issue rust-lang#83186 remains open to track `fs_try_exists`.
Rollup of 4 pull requests Successful merges: - rust-lang#95534 (Add `core::mem::copy` to complement `core::mem::drop`.) - rust-lang#97912 (Stabilize `Path::try_exists()` and improve doc) - rust-lang#98225 (Make debug_triple depend on target json file content rather than file path) - rust-lang#98257 (Fix typos in `IntoFuture` docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This stabilizes the
Path::try_exists()method which returnsResult<bool, io::Error>instead ofboolallowing handling of errorsunrelated to the file not existing. (e.g permission errors)
Along with the stabilization it also:
exists()method is error-prone and suggests to usethe newly stabilized one.
metadata()to handle errors.try_exists()iscompletely safe fixed version of
exists().std::fs::try_exists()tofs_try_existsto avoid name conflict.The tracking issue #83186 remains open to track
fs_try_exists.