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

Added the documentation for the 'use' keyword #72761

Merged
merged 3 commits into from
Jun 8, 2020

Conversation

poliorcetics
Copy link
Contributor

This is a partial fix of #34601.

I heavily inspired myself from the Reference on the use keyword.

I checked the links when compiling the documentation, they should be ok.

I also added an example for the wildcard * in the case of types, because it's behaviour is not import everything like one might think at first.

@rust-highfive
Copy link
Collaborator

r? @LukasKalbertodt

(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 May 29, 2020
src/libstd/keyword_docs.rs Outdated Show resolved Hide resolved
src/libstd/keyword_docs.rs Outdated Show resolved Hide resolved
Fix suggestions from review.

Co-authored-by: Bastian Kauschke <bastian_kauschke@hotmail.de>
@poliorcetics
Copy link
Contributor Author

@lcnr Since _ is for traits only, should I add an example for that too or is the line about it clear enough ?

src/libstd/keyword_docs.rs Outdated Show resolved Hide resolved
@lcnr
Copy link
Contributor

lcnr commented May 30, 2020

I think an example would be helpful here, but as this feature is very rarely used, a link to
https://doc.rust-lang.org/stable/reference/items/use-declarations.html?highlight=use#underscore-imports might be better.

@poliorcetics
Copy link
Contributor Author

I think an example would be helpful here, but as this feature is very rarely used, a link to
https://doc.rust-lang.org/stable/reference/items/use-declarations.html?highlight=use#underscore-imports might be better.

There is a link to this page already (though not the exact section), the one named as [Reference], should repeat it once more (with the exact section) or is okay with what's already here ?

@lcnr
Copy link
Contributor

lcnr commented May 30, 2020

Seems good to me 👍

@Dylan-DPC-zz
Copy link

r? @Dylan-DPC

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 7, 2020

📌 Commit 4bae9e5 has been approved by Dylan-DPC

@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 Jun 7, 2020
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 8, 2020
Rollup of 10 pull requests

Successful merges:

 - rust-lang#72026 (Update annotate-snippets-rs to 0.8.0)
 - rust-lang#72583 (impl AsRef<[T]> for vec::IntoIter<T>)
 - rust-lang#72615 (Fix documentation example for gcov profiling)
 - rust-lang#72761 (Added the documentation for the 'use' keyword)
 - rust-lang#72799 (Add `-Z span-debug` to allow for easier debugging of proc macros)
 - rust-lang#72811 (Liballoc impl)
 - rust-lang#72963 (Cstring `from_raw` and `into_raw` safety precisions)
 - rust-lang#73001 (Free `default()` forwarding to `Default::default()`)
 - rust-lang#73075 (Add comments to `Resolve::get_module`)
 - rust-lang#73092 (Clean up E0646)

Failed merges:

r? @ghost
@bors bors merged commit 89d8979 into rust-lang:master Jun 8, 2020
@poliorcetics poliorcetics deleted the use-keyword-doc branch June 8, 2020 20:21
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.

None yet

6 participants