-
Notifications
You must be signed in to change notification settings - Fork 13.5k
clarify docs for std:io::fs::Path::{is_dir,is_file,exists}; add lstat #13750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/// | ||
/// Will not raise a condition | ||
/// This call preserves identical runtime/error semantics with `file::lstat`. | ||
pub fn lstat(&self) -> IoResult<FileStat> { stat(self) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure you meant to call lstat(self)
here.
Are there any tests for |
r=me with my comments addressed and some minimal tests added. |
@kballard I've now expanded existing unit tests for As a sidenote, the rationale for when functionality should be exposed as a function versus a method (or both) wasn't entirely clear to me. I brought it up on IRC, but discussion was inconclusive -- the main benefit of methods seem to be that you don't need imports to get access to them. In any case, it seems a shame to have (notably, error-prone) boilerplate like these wrapper methods, which then requires redundant testing. But for this patch, I'm sticking with the existing pattern. |
/// | ||
/// # Error | ||
/// Consult the `file::lstat` documentation for more info. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fs::lstat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(and below)
Clarifies the interaction of `is_dir`, `is_file` and `exists` with symbolic links. Adds a convenience `lstat` function alongside of `stat`. Removes references to conditions. Closes issue rust-lang#12583.
@alexcrichton fixed, thanks. |
|
@alexcrichton yep -- I only added method-based |
Clarifies the interaction of `is_dir`, `is_file` and `exists` with symbolic links. Adds a convenience `lstat` function alongside of `stat`. Removes references to conditions. Closes issue #12583.
…bold fix: normalize projection after discarding free `BoundVar`s in RPIT Fixes rust-lang#13307 When we lower the return type of a function, it may contain free `BoundVar`s in `OpaqueType`'s substitution, which would cause panic during canonicalization as part of projection normalization. Those `BoundVar`s are irrelevant in this context and will be discarded, and we should defer projection normalization until then.
Clarifies the interaction of
is_dir
,is_file
andexists
withsymbolic links. Adds a convenience
lstat
function alongside ofstat
. Removes references to conditions.Closes issue #12583.