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

Xaeroxe

Fixes #56544

This paragraph was written for Rust 2015. Since 2018 has been stable for a while I think we can update it.

@Xaeroxe

@rust-highfive

r? @alexcrichton

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

@varkor

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

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

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 ?

@Xaeroxe

@QuietMisdreavus

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

@Dylan-DPC-zz

QuietMisdreavus

//! 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

@QuietMisdreavus

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

@Xaeroxe

Done, thanks for the tip!

QuietMisdreavus

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

@bors

📌 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

@Centril

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

@Centril

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

@bors

Rollup of 11 pull requests

Successful merges:

Failed merges:

r? @ghost

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.