Forbid Path::exists
This function is simply wrong. As its own documentation says:
Warning: this method may be error-prone, consider using try_exists() instead!
We should use try_exists
or std::fs::exists
instead, and we should add Path::exists
to disallowed-methods
in clippy.toml
.
Upstream have managed not to fix this situation and failed to deprecate this broken function, or even add it to the default clippy lints :-/. But we shouldn't have it anywhere in our codebase. (Not even in tests.)
Tagging this ticket as "Bug" because any use of Path::is_exists
is an error handling bug.