Commit 5608707
committed
Stabilize
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`.Path::try_exists() and improve doc1 parent edab34a commit 5608707
3 files changed
+17
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2317 | 2317 | | |
2318 | 2318 | | |
2319 | 2319 | | |
| 2320 | + | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
2320 | 2324 | | |
2321 | 2325 | | |
2322 | 2326 | | |
2323 | | - | |
| 2327 | + | |
2324 | 2328 | | |
2325 | 2329 | | |
2326 | 2330 | | |
| |||
2330 | 2334 | | |
2331 | 2335 | | |
2332 | 2336 | | |
2333 | | - | |
| 2337 | + | |
2334 | 2338 | | |
2335 | 2339 | | |
2336 | 2340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2705 | 2705 | | |
2706 | 2706 | | |
2707 | 2707 | | |
| 2708 | + | |
| 2709 | + | |
| 2710 | + | |
2708 | 2711 | | |
2709 | 2712 | | |
2710 | 2713 | | |
| |||
2721 | 2724 | | |
2722 | 2725 | | |
2723 | 2726 | | |
2724 | | - | |
| 2727 | + | |
| 2728 | + | |
| 2729 | + | |
2725 | 2730 | | |
2726 | 2731 | | |
2727 | 2732 | | |
| |||
2738 | 2743 | | |
2739 | 2744 | | |
2740 | 2745 | | |
| 2746 | + | |
| 2747 | + | |
| 2748 | + | |
| 2749 | + | |
2741 | 2750 | | |
2742 | 2751 | | |
2743 | 2752 | | |
2744 | | - | |
2745 | | - | |
2746 | 2753 | | |
2747 | 2754 | | |
2748 | 2755 | | |
2749 | 2756 | | |
2750 | 2757 | | |
2751 | 2758 | | |
2752 | | - | |
2753 | | - | |
2754 | | - | |
| 2759 | + | |
2755 | 2760 | | |
2756 | 2761 | | |
2757 | 2762 | | |
| |||
0 commit comments