Update std/lib.rs docs to reflect Rust 2018 usage by Xaeroxe · Pull Request #57179 · rust-lang/rust (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation15 Commits2 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Fixes #56544
This paragraph was written for Rust 2015. Since 2018 has been stable for a while I think we can update it.
(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
?
(There might already be a docs convention for this; I'm not sure.)
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 ?
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.
Generally, we document things "in the present", so we'd default to Rust 2018.
+1 to 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`]. |
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?
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 [crate root]
and [`::std::env::args`]
, can you take those link targets out of the big group at the bottom of that doc comment? Might as well clean those up while we're here.
Done, thanks for the tip!
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!
📌 Commit 4781c6f has been approved by QuietMisdreavus
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Centril added a commit to Centril/rust that referenced this pull request
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.
Centril added a commit to Centril/rust that referenced this pull request
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.
bors added a commit that referenced this pull request
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
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.