-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use more std:: instead of core:: in docs for consistency #79611
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
I think this function might only be in r=me once you get CI passing. |
It's only in core yes, but why ? |
b720436
to
39c6747
Compare
39c6747
to
4eb76fc
Compare
It should be, but it's not currently: #79174 |
@bors r+ rollup |
📌 Commit 4eb76fc has been approved by |
Use more std:: instead of core:: in docs for consistency `@rustbot` label T-doc Some cleanup work to use `std::` instead of `core::` in docs as much as possible. This helps with terminology and consistency, especially for newcomers from other languages that have often heard of `std` to describe the standard library but not of `core`. Edit: I also added more intra doc links when I saw the opportunity.
Rollup of 11 pull requests Successful merges: - rust-lang#77686 (Render Markdown in search results) - rust-lang#79541 (Doc keyword lint pass) - rust-lang#79602 (Fix SGX CI) - rust-lang#79611 (Use more std:: instead of core:: in docs for consistency) - rust-lang#79623 (Pass around Symbols instead of Idents in doctree) - rust-lang#79627 (Update cargo) - rust-lang#79631 (disable a ptr equality test on Miri) - rust-lang#79638 (Use `item_name` instead of pretty printing for resolving `Self` on intra-doc links) - rust-lang#79646 (rustc_metadata: Remove some dead code) - rust-lang#79664 (move interpret::MemoryKind::Heap to const eval) - rust-lang#79678 (Fix some clippy lints) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
It feels very weird to have doc examples in libcore which reference |
This was already the case for the vast majority of the examples, this PR made it more consistent. I also feel like no_std users are more "advanced" and certainly know to change std to core in their code. There is also the problem that items in core are reexported in std so they end up with a documentation example on core::Something when they are looking at std::Something. |
Not necessarily. With no_std becoming more popular due to wasm and embedded I totally expect that in the future even more people will jump in directly without knowing too much about the distinction.
It would be great if there was a more general solution to properly handling re-exports, e.g. by rewriting re-exports automatically to the namespace at hand. |
True, I forgot about
Merging |
@rustbot label T-doc
Some cleanup work to use
std::
instead ofcore::
in docs as much as possible. This helps with terminology and consistency, especially for newcomers from other languages that have often heard ofstd
to describe the standard library but not ofcore
.Edit: I also added more intra doc links when I saw the opportunity.