-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Incorrect example at using Path #10241
Comments
Hi, thanks for the report; looks like you are correct, but this function is being removed in #10179 (replaced by (In any case, this prompted me to go and double check the documentation @alexcrichton had written there, and caught a few similar mistakes, so perfect timing. :) ) |
Ah yes, thanks for pointing this out! I should have fixed all of the examples in |
This renames the `file` module to `fs` because that more accurately describes its current purpose (manipulating the filesystem, not just files). Additionally, this adds an UnstableFileStat structure as a nested structure of FileStat to signify that the fields should not be depended on. The structure is currently flagged with #[unstable], but it's unlikely that it has much meaning. Closes rust-lang#10241
manual_let_else: do not suggest semantically different replacements The problem is that this lint does not consider the possibility that the divergent branch can come first and that the patterns may overlap. This led to incorrect suggestions, previously registered as correct in the tests themselves: ```rust let v = match build_enum() { _ => continue, Variant::Bar(v) | Variant::Baz(v) => v, }; ``` had a `let Variant::Bar(v) | Variant::Baz(v) = v else { continue; }` suggestion, which is obviously wrong as the original code `continue`s in any case. Issue rust-lang#10241 gives another example. The code now checks that the divergent branch comes second. It could be extended later (I've added a TODO) to check for non-overlapping patterns. Fixes rust-lang#10241. changelog: [`manual_let_else`] do not suggest non equivalent replacements in `match`
Use of path::Path incorrect in http://static.rust-lang.org/doc/master/std/rt/io/file/fn.open.html
Instead of
let p = &Path("/some/file/path.txt");
, should belet p = &Path::new("/some/file/path.txt");
The text was updated successfully, but these errors were encountered: