about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-06-20 07:37:41 +0900
committerGitHub <noreply@github.com>2022-06-20 07:37:41 +0900
commit77316a4aaa0029481397ff2e43f57e60d5226569 (patch)
treec0ad6c9c6fcd2a75ead6bf863b42ca65e59a3788 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parent9d4e08e725592a703b9846a8421ff5eed0aff3c3 (diff)
parent56087074c655bc17af048ad6483ecf7c32ce1762 (diff)
downloadrust-77316a4aaa0029481397ff2e43f57e60d5226569.tar.gz
rust-77316a4aaa0029481397ff2e43f57e60d5226569.zip
Rollup merge of #97912 - Kixunil:stabilize_path_try_exists, 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 #83186 remains open to track `fs_try_exists`.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions