Skip to content
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

Merged
merged 2 commits into from
Jan 24, 2019

Conversation

Xaeroxe
Copy link
Contributor

@Xaeroxe Xaeroxe commented Dec 28, 2018

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
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 28, 2018
@varkor
Copy link
Member

varkor commented Dec 28, 2018

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.)

@Xaeroxe
Copy link
Contributor Author

Xaeroxe commented Dec 28, 2018

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.

@steveklabnik
Copy link
Member

This is great, thanks! This fixes #56544, any chance you could amend the commit message to say

Fixes #56544 

?

(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 ?

@Xaeroxe
Copy link
Contributor Author

Xaeroxe commented Dec 28, 2018

Sure!

@QuietMisdreavus
Copy link
Member

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.

@alexcrichton
Copy link
Member

r? @QuietMisdreavus

@Dylan-DPC-zz
Copy link

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`].
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They did yeah

@QuietMisdreavus
Copy link
Member

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.

@Xaeroxe
Copy link
Contributor Author

Xaeroxe commented Jan 22, 2019

Done, thanks for the tip!

Copy link
Member

@QuietMisdreavus QuietMisdreavus left a 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!

@QuietMisdreavus
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jan 22, 2019

📌 Commit 4781c6f has been approved by QuietMisdreavus

@bors 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 Jan 22, 2019
Centril added a commit to Centril/rust that referenced this pull request Jan 23, 2019
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 Jan 23, 2019
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 Jan 24, 2019
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
@bors bors merged commit 4781c6f into rust-lang:master Jan 24, 2019
@Xaeroxe Xaeroxe deleted the patch-1 branch December 28, 2019 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants