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

Remove leading :: from paths in doc examples #65633

Merged
merged 1 commit into from
Oct 21, 2019

Conversation

Rantanen
Copy link
Contributor

Noted some pre-2018 path syntax in the doc examples, for example:
https://doc.rust-lang.org/std/process/fn.exit.html

fn main() {
    ::std::process::exit(match run_app() {
       Ok(_) => 0,
       ...

Couldn't find an existing issue on this (then again, "::" makes for an annoying thing to search for) so if there is already something fixing this and/or there's a reason to not fix it, just close this PR.

(Also fixed indentation in the process::exit() docs)

@rust-highfive
Copy link
Collaborator

r? @withoutboats

(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 Oct 20, 2019
@Centril
Copy link
Contributor

Centril commented Oct 20, 2019

Note that a leading :: is merely redundant in these cases, not wrong.

Thanks tho! r? @Centril @bors r+ rollup

@bors
Copy link
Contributor

bors commented Oct 20, 2019

📌 Commit 040d88d has been approved by Centril

@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 Oct 20, 2019
@Rantanen
Copy link
Contributor Author

I thought those were deprecated with 2018 - but I guess that affected only the ::local_mod::something() paths. Oh well!

Paths starting with :: aren't mentioned in the book either (or alternatively I'm blind) so I guess it makes sense to avoid them in the examples.

@Centril
Copy link
Contributor

Centril commented Oct 20, 2019

@Rantanen In the 2018 edition, a path starting with :: always starts from the extern prelude and refers to an external crate. Most of the time such disambiguation is unnecessary however so the change in this PR is towards the more idiomatic.

Centril added a commit to Centril/rust that referenced this pull request Oct 20, 2019
Remove leading :: from paths in doc examples

Noted some pre-2018 path syntax in the doc examples, for example:
https://doc.rust-lang.org/std/process/fn.exit.html

```rust
fn main() {
    ::std::process::exit(match run_app() {
       Ok(_) => 0,
       ...
```

Couldn't find an existing issue on this (then again, "::" makes for an annoying thing to search for) so if there is already something fixing this and/or there's a reason to not fix it, just close this PR.

(Also fixed indentation in the `process::exit()` docs)
bors added a commit that referenced this pull request Oct 20, 2019
Rollup of 8 pull requests

Successful merges:

 - #65314 (rustdoc: forward -Z options to rustc)
 - #65592 (clarify const_prop ICE protection comment)
 - #65603 (Avoid ICE when include! is used by stdin crate)
 - #65614 (Improve error message for APIT with explicit generic arguments)
 - #65629 (Remove `borrowck_graphviz_postflow` from test)
 - #65633 (Remove leading :: from paths in doc examples)
 - #65638 (Rename the default argument 'def' to 'default')
 - #65639 (Fix parameter name in documentation)

Failed merges:

r? @ghost
@bors bors merged commit 040d88d into rust-lang:master Oct 21, 2019
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.

5 participants