-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Update std/lib.rs docs to reflect Rust 2018 usage #57179
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Rust 2018 doesn't replace Rust 2015: I think it'd be better here to explicitly note the differences between the 2015 and 2018 editions. (There might already be a docs convention for this; I'm not sure.) |
People reading the std library for the first time are more likely to be using 2018 since that's the new default for cargo, however I'll defer to established standards if they exist. |
This is great, thanks! This fixes #56544, any chance you could amend the commit message to say
?
We haven't discussed it! Generally, we document things "in the present", so we'd default to Rust 2018. I'd be open to an exception here. @rust-lang/docs ? |
Sure! |
I feel like we should leave in the mention of absolute paths, since they're still a thing in 2015 (unless i'm wrong here?). Otherwise, since 2018 is going to be what most people are writing about in the future, explaining things in terms of that perspective is probably going to be best.
+1 to this. |
ping from triage @QuietMisdreavus waiting for your review on this |
//! standard library can be accessed in [`use`] statements through the path | ||
//! `std`, as in [`use std::env`], or in expressions through the absolute path | ||
//! `::std`, as in [`::std::env::args`]. |
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 don't actually know the full extent of the path changes that were introduced in Rust 2018; did absolute paths like this go away as well?
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.
They did yeah
Since you removed the link anchors for |
Done, thanks for the tip! |
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 think this is good. Since 2018 is the default now, it doesn't make much sense to include details about extern crate
statements, and the remaining text also applies to 2015 code, since it can still use std::env
the same way. Let's get this merged, thanks so much!
@bors r+ rollup |
📌 Commit 4781c6f has been approved by |
Update std/lib.rs docs to reflect Rust 2018 usage Fixes rust-lang#56544 This paragraph was written for Rust 2015. Since 2018 has been stable for a while I think we can update it.
Update std/lib.rs docs to reflect Rust 2018 usage Fixes rust-lang#56544 This paragraph was written for Rust 2015. Since 2018 has been stable for a while I think we can update it.
Rollup of 11 pull requests Successful merges: - #57179 (Update std/lib.rs docs to reflect Rust 2018 usage) - #57730 (Merge visitors in AST validation) - #57779 (Recover from parse errors in literal struct fields and incorrect float literals) - #57793 (Explain type mismatch cause pointing to return type when it is `impl Trait`) - #57795 (Use structured suggestion in stead of notes) - #57817 (Add error for trailing angle brackets.) - #57834 (Stabilize Any::get_type_id and rename to type_id) - #57836 (Fix some cross crate existential type ICEs) - #57840 (Fix issue 57762) - #57844 (use port 80 for retrieving GPG key) - #57858 (Ignore line ending on older git versions) Failed merges: r? @ghost
Fixes #56544
This paragraph was written for Rust 2015. Since 2018 has been stable for a while I think we can update it.