# documentation

**URL:** https://internals.rust-lang.org/c/documentation/14.md?page=1

[Latest](https://internals.rust-lang.org/latest.md) · [Categories](https://internals.rust-lang.org/categories.md)

**Page:** 2

---

## [Doc Presentation](https://internals.rust-lang.org/t/doc-presentation/20532)

<div class="topic-metadata">

**Author:** [@Dwarsloeper](https://internals.rust-lang.org/u/Dwarsloeper)\
**Replies:** 6\
**Last updated:** [March 26, 2024, 12:04pm UTC](https://internals.rust-lang.org/t/doc-presentation/20532 "2024-03-26T12:04:23Z")

</div>

While I agree that the Rust generated doc is great, I still often find it annoying. I often elatedly click on a promising-sounding function on the left, only to see that it is unsafe, experimental and/or deprecated. I co…

---

## [RustDoc: Group methods for easy of navigation](https://internals.rust-lang.org/t/rustdoc-group-methods-for-easy-of-navigation/20392)

<div class="topic-metadata">

**Author:** [@hack.augusto](https://internals.rust-lang.org/u/hack.augusto)\
**Replies:** 17\
**Last updated:** [March 14, 2024, 7:28am UTC](https://internals.rust-lang.org/t/rustdoc-group-methods-for-easy-of-navigation/20392 "2024-03-14T07:28:28Z")

</div>

I couldn't find an issue/topic about this, pardon me if I missed it. This is a small feature request, to categorize a trait/impl methods by receiver type. The rationale is that when exploring the docs of a new crate, on…

---

## [Why use nightly for docs.rs?](https://internals.rust-lang.org/t/why-use-nightly-for-docs-rs/20409)

<div class="topic-metadata">

**Author:** [@jpleyer](https://internals.rust-lang.org/u/jpleyer)\
**Replies:** 33\
**Last updated:** [March 11, 2024, 11:39am UTC](https://internals.rust-lang.org/t/why-use-nightly-for-docs-rs/20409 "2024-03-11T11:39:00Z")

</div>

The title basically says it. Let me give an illustrative example. Example I was recently fixing a bug in servo/pathfinder which I came across only because I was compiling the plotters crate with the current nightly comp…

---

## [RustDoc: hyperlinks in (text) code blocks/snippets](https://internals.rust-lang.org/t/rustdoc-hyperlinks-in-text-code-blocks-snippets/20442)

<div class="topic-metadata">

**Author:** [@Rafaeltheraven](https://internals.rust-lang.org/u/Rafaeltheraven)\
**Replies:** 7\
**Last updated:** [March 7, 2024, 3:47pm UTC](https://internals.rust-lang.org/t/rustdoc-hyperlinks-in-text-code-blocks-snippets/20442 "2024-03-07T15:47:22Z")

</div>

This might be a highly specific use-case. I am currently writing a parser and in the documentation I would like to have little snippets of the grammar showing what some specific struct represents. For example: /// # Gra…

---

## [Compiling byte code and how to correctly restore write functionality of a pointer?](https://internals.rust-lang.org/t/compiling-byte-code-and-how-to-correctly-restore-write-functionality-of-a-pointer/20276)

<div class="topic-metadata">

**Author:** [@WorldSEnder](https://internals.rust-lang.org/u/WorldSEnder)\
**Replies:** 6\
**Last updated:** [February 8, 2024, 7:49am UTC](https://internals.rust-lang.org/t/compiling-byte-code-and-how-to-correctly-restore-write-functionality-of-a-pointer/20276 "2024-02-08T07:49:48Z")

</div>

I want to write a small compiler for a simple bytecode language. This byte code operates on a machine with some static amount of memory, and can read and write to constant offsets, see a small snippet of the approximate …

---

## [More granular \`missing\_docs\`?](https://internals.rust-lang.org/t/more-granular-missing-docs/19953)

<div class="topic-metadata">

**Author:** [@dpc](https://internals.rust-lang.org/u/dpc)\
**Replies:** 3\
**Last updated:** [December 3, 2023, 6:38am UTC](https://internals.rust-lang.org/t/more-granular-missing-docs/19953 "2023-12-03T06:38:52Z")

</div>

In my experience the single most valuable docstring are ones on the structs, as there are least amount of them, yet they are the very core of every project. Then the docs on the methods, and the rest is great to have bu…

---

## [pre-RFC: List all re-exported items, including those imported by wildcards, in rust docs](https://internals.rust-lang.org/t/pre-rfc-list-all-re-exported-items-including-those-imported-by-wildcards-in-rust-docs/19839)

<div class="topic-metadata">

**Author:** [@sam0x17](https://internals.rust-lang.org/u/sam0x17)\
**Replies:** 1\
**Last updated:** [November 8, 2023, 9:10pm UTC](https://internals.rust-lang.org/t/pre-rfc-list-all-re-exported-items-including-those-imported-by-wildcards-in-rust-docs/19839 "2023-11-08T21:10:59Z")

</div>

Originally contemplated here: feature request: collapsable tree view for items included via pub re-exports · Issue #2310 · rust-lang/docs.rs · GitHub Right now many crates will do large public re-exports of a prelude or…

---

## [Implicit use of a trait in its implementation leaks through a module](https://internals.rust-lang.org/t/implicit-use-of-a-trait-in-its-implementation-leaks-through-a-module/19724)

<div class="topic-metadata">

**Author:** [@GoldsteinE](https://internals.rust-lang.org/u/GoldsteinE)\
**Replies:** 2\
**Last updated:** [October 17, 2023, 10:30am UTC](https://internals.rust-lang.org/t/implicit-use-of-a-trait-in-its-implementation-leaks-through-a-module/19724 "2023-10-17T10:30:25Z")

</div>

Consider this code (playground): mod a { pub trait Foo { fn bar(&self); } } impl a::Foo for () { fn bar(&self) { mod hide { // We're in a new module... pub fn baz() { …

---

## [Force documentations to add small sections providing high-level documentation and "how-to"s for each element of a crate](https://internals.rust-lang.org/t/force-documentations-to-add-small-sections-providing-high-level-documentation-and-how-to-s-for-each-element-of-a-crate/19425)

<div class="topic-metadata">

**Author:** [@Spavi](https://internals.rust-lang.org/u/Spavi)\
**Replies:** 8\
**Last updated:** [September 3, 2023, 12:30pm UTC](https://internals.rust-lang.org/t/force-documentations-to-add-small-sections-providing-high-level-documentation-and-how-to-s-for-each-element-of-a-crate/19425 "2023-09-03T12:30:36Z")

</div>

Abstract Most of the crates out there don't provide high level documentation thus leaving some programmers like me scrabbing through examples and getting a headache trying to figure out how things work. This is even tru…

---

## [How do you discover crate features when using a new crate?](https://internals.rust-lang.org/t/how-do-you-discover-crate-features-when-using-a-new-crate/19435)

<div class="topic-metadata">

**Author:** [@cbeck88](https://internals.rust-lang.org/u/cbeck88)\
**Replies:** 5\
**Last updated:** [August 29, 2023, 1:57am UTC](https://internals.rust-lang.org/t/how-do-you-discover-crate-features-when-using-a-new-crate/19435 "2023-08-29T01:57:17Z")

</div>

First, let me start by saying that rust doc and the cargo docs are generally great, and a lot of people put a lot of effort into documenting how to use their code. When I start using a new crate, usually the first thing…

---

## [Why doesn't documentation for \`struct\` and \`enum\` mention that tuple constructors can be used as normal functions?](https://internals.rust-lang.org/t/why-doesnt-documentation-for-struct-and-enum-mention-that-tuple-constructors-can-be-used-as-normal-functions/19195)

<div class="topic-metadata">

**Author:** [@HjVT](https://internals.rust-lang.org/u/HjVT)\
**Replies:** 1\
**Last updated:** [July 21, 2023, 7:51am UTC](https://internals.rust-lang.org/t/why-doesnt-documentation-for-struct-and-enum-mention-that-tuple-constructors-can-be-used-as-normal-functions/19195 "2023-07-21T07:51:57Z")

</div>

It is pretty surprising for newcomers to find out and feels like arcane forbidden knowledge due this lack of documentation. Relevant doc pages:

---

## [Feature Request: Improve constants generated docs](https://internals.rust-lang.org/t/feature-request-improve-constants-generated-docs/19191)

<div class="topic-metadata">

**Author:** [@DJDuque](https://internals.rust-lang.org/u/DJDuque)\
**Replies:** 1\
**Last updated:** [July 20, 2023, 10:28pm UTC](https://internals.rust-lang.org/t/feature-request-improve-constants-generated-docs/19191 "2023-07-20T22:28:54Z")

</div>

I am not sure this is the right place to post this, but I was going to open an issue on GitHub, and it says to post all feature requests in this forum. My motivation is more clear if you read this issue here (Improve \`c…

---

## [Rustdoc: distinguish 'Provided' trait methods with 'Auxilliary' sub-category](https://internals.rust-lang.org/t/rustdoc-distinguish-provided-trait-methods-with-auxilliary-sub-category/19162)

<div class="topic-metadata">

**Author:** [@dhardy](https://internals.rust-lang.org/u/dhardy)\
**Replies:** 4\
**Last updated:** [July 17, 2023, 8:24pm UTC](https://internals.rust-lang.org/t/rustdoc-distinguish-provided-trait-methods-with-auxilliary-sub-category/19162 "2023-07-17T20:24:09Z")

</div>

Take a look at the docs for Iterator: Required Associated Types type Item Required Methods fn next(&mut self) -\> Option\<Self::Item\> Provided Methods \[a very long list here\] This is sufficient to convey the mi…

---

## [Incorrect \`Box::clone\` doc](https://internals.rust-lang.org/t/incorrect-box-clone-doc/18960)

<div class="topic-metadata">

**Author:** [@Qsh](https://internals.rust-lang.org/u/Qsh)\
**Replies:** 2\
**Last updated:** [June 9, 2023, 5:23pm UTC](https://internals.rust-lang.org/t/incorrect-box-clone-doc/18960 "2023-06-09T17:23:18Z")

</div>

The current document is a clone() of this box's contents. But in reality, its behavior is specialized, if the content impl Copy, will not call clone. What is our expected behavior, should we modify the document o…

---

## [Relative URL in doc comments](https://internals.rust-lang.org/t/relative-url-in-doc-comments/18382)

<div class="topic-metadata">

**Author:** [@Redglyph](https://internals.rust-lang.org/u/Redglyph)\
**Replies:** 3\
**Last updated:** [February 20, 2023, 3:07pm UTC](https://internals.rust-lang.org/t/relative-url-in-doc-comments/18382 "2023-02-20T15:07:47Z")

</div>

Hello all, I noticed a problem in the doc comments of the Rust libraries, with many links to HTML pages were relative URLs. For instance in library/core/src/ops/deref.rs, for Deref: /// For more details, visit \[the chap…

---

## [Nightly feature preview in the docs search menu](https://internals.rust-lang.org/t/nightly-feature-preview-in-the-docs-search-menu/18315)

<div class="topic-metadata">

**Author:** [@zim0369](https://internals.rust-lang.org/u/zim0369)\
**Replies:** 2\
**Last updated:** [February 11, 2023, 8:16pm UTC](https://internals.rust-lang.org/t/nightly-feature-preview-in-the-docs-search-menu/18315 "2023-02-11T20:16:50Z")

</div>

This is the search menu on the Rust's documentation website. A column here to indicate if whether the feature is nightly without having to open it would be convenient & time saving. We could also use a different shade …

---

## [Rustdoc suggestion: Highlight links \`fn\`s, \`mod\`s \`type\`s etc. appropriately within \`///\` and \`//!\` documentation](https://internals.rust-lang.org/t/rustdoc-suggestion-highlight-links-fn-s-mod-s-type-s-etc-appropriately-within-and-documentation/17931)

<div class="topic-metadata">

**Author:** [@LeoniePhiline](https://internals.rust-lang.org/u/LeoniePhiline)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 11:45pm UTC](https://internals.rust-lang.org/t/rustdoc-suggestion-highlight-links-fn-s-mod-s-type-s-etc-appropriately-within-and-documentation/17931 "2023-01-20T23:45:07Z")

</div>

While reading documentation, especially when discovering the API of a new crate, I got the impression that human readers could get an easier understanding of the referenced items if they were appropriately highlighted. C…

---

## [Rustdoc: interest in producing intersphinx index files?](https://internals.rust-lang.org/t/rustdoc-interest-in-producing-intersphinx-index-files/18059)

<div class="topic-metadata">

**Author:** [@masklinn](https://internals.rust-lang.org/u/masklinn)\
**Replies:** 6\
**Last updated:** [January 5, 2023, 8:53pm UTC](https://internals.rust-lang.org/t/rustdoc-interest-in-producing-intersphinx-index-files/18059 "2023-01-05T20:53:07Z")

</div>

intersphinx works through an index file (usually "objects.inv") which seems to have a relatively simple structure. I figure it could be useful for rustdoc to produce such an index (alongside any index it already does pr…

---

## [Rustdoc hiding important bounds](https://internals.rust-lang.org/t/rustdoc-hiding-important-bounds/17753)

<div class="topic-metadata">

**Author:** [@2e71828](https://internals.rust-lang.org/u/2e71828)\
**Replies:** 12\
**Last updated:** [November 20, 2022, 7:07pm UTC](https://internals.rust-lang.org/t/rustdoc-hiding-important-bounds/17753 "2022-11-20T19:07:34Z")

</div>

I was playing around with some HashMap trait object silliness, so I went to the docs to find out the necessary bounds for HashMap::insert(). To my surprise, it appears that there are no bounds on K at all. In practice,…

---

## [Rustdoc exposing private information](https://internals.rust-lang.org/t/rustdoc-exposing-private-information/17673)

<div class="topic-metadata">

**Author:** [@tczajka](https://internals.rust-lang.org/u/tczajka)\
**Replies:** 17\
**Last updated:** [November 9, 2022, 10:17am UTC](https://internals.rust-lang.org/t/rustdoc-exposing-private-information/17673 "2022-11-09T10:17:56Z")

</div>

Rustdoc seems to expose unnecessary implementation details about private fields and #\[non\_exhaustive\] in structs. For example: pub struct A0(()); pub struct A1((), ()); #\[non\_exhaustive\] pub struct A2; #\[non\_exhaust…

---

## [Mentioning about the memory consumption of different collections](https://internals.rust-lang.org/t/mentioning-about-the-memory-consumption-of-different-collections/17607)

<div class="topic-metadata">

**Author:** [@thomas-k-cameron](https://internals.rust-lang.org/u/thomas-k-cameron)\
**Replies:** 9\
**Last updated:** [October 25, 2022, 4:41am UTC](https://internals.rust-lang.org/t/mentioning-about-the-memory-consumption-of-different-collections/17607 "2022-10-25T04:41:37Z")

</div>

I noticed that BTree takes up roughly about 3 times as much ram as Vec and somewhere around twice as much as Hashmap. I wrote a little code to check how much ram does Vec, Btree, HashMap (with default hasher), VecDeque,…

---

## [Inline mermaid.js support](https://internals.rust-lang.org/t/inline-mermaid-js-support/17581)

<div class="topic-metadata">

**Author:** [@seanandyrush](https://internals.rust-lang.org/u/seanandyrush)\
**Replies:** 5\
**Last updated:** [October 17, 2022, 6:23pm UTC](https://internals.rust-lang.org/t/inline-mermaid-js-support/17581 "2022-10-17T18:23:08Z")

</div>

I'd like to have support for inline diagrams (like mermaid.js) in rustdoc markdowns.

---

## [Markdowns as comments](https://internals.rust-lang.org/t/markdowns-as-comments/17486)

<div class="topic-metadata">

**Author:** [@rohitisinhk](https://internals.rust-lang.org/u/rohitisinhk)\
**Replies:** 4\
**Last updated:** [October 7, 2022, 6:54am UTC](https://internals.rust-lang.org/t/markdowns-as-comments/17486 "2022-10-07T06:54:38Z")

</div>

At present the comments look and work ok but I wish we could write comments as markdown so it gets highlighted and formatted so they are more readable both in editor and online such as github.

---

## [Change the argument name of From::from](https://internals.rust-lang.org/t/change-the-argument-name-of-from-from/17480)

<div class="topic-metadata">

**Author:** [@Sky9](https://internals.rust-lang.org/u/Sky9)\
**Replies:** 3\
**Last updated:** [October 6, 2022, 1:14pm UTC](https://internals.rust-lang.org/t/change-the-argument-name-of-from-from/17480 "2022-10-06T13:14:05Z")

</div>

The From trait is currently defined as: pub trait From\<T\>: Sized { fn from(\_: T) -\> Self; } The name of the argument is \_. I am proposing to change it to value, ie. pub trait From\<T\>: Sized { fn from(value: T)…

---

## [Bug in the docs? str::find is stable, but std::str::pattern::Pattern isn't](https://internals.rust-lang.org/t/bug-in-the-docs-str-find-is-stable-but-std-pattern-isnt/17439)

<div class="topic-metadata">

**Author:** [@ckaran](https://internals.rust-lang.org/u/ckaran)\
**Replies:** 6\
**Last updated:** [September 23, 2022, 7:05pm UTC](https://internals.rust-lang.org/t/bug-in-the-docs-str-find-is-stable-but-std-pattern-isnt/17439 "2022-09-23T19:05:35Z")

</div>

I just noticed that str::find uses std::str::pattern::Pattern in its signature, but while find is stable, Pattern is still experimental. Is this a bug in the docs?

---

## [Feature Request: Add Example Repos to The Book](https://internals.rust-lang.org/t/feature-request-add-example-repos-to-the-book/16977)

<div class="topic-metadata">

**Author:** [@HarrisonHemstreet](https://internals.rust-lang.org/u/HarrisonHemstreet)\
**Replies:** 2\
**Last updated:** [July 12, 2022, 11:54pm UTC](https://internals.rust-lang.org/t/feature-request-add-example-repos-to-the-book/16977 "2022-07-12T23:54:42Z")

</div>

As a newcomer to Rust, I would really appreciate it if the team were to attach several repos to the documentation so that I could see Rust in action at small, medium, and large scale settings. I feel that doing this woul…

---

## [Pattern Grammar Ambiguity](https://internals.rust-lang.org/t/pattern-grammar-ambiguity/17158)

<div class="topic-metadata">

**Author:** [@2e71828](https://internals.rust-lang.org/u/2e71828)\
**Replies:** 13\
**Last updated:** [August 10, 2022, 2:37am UTC](https://internals.rust-lang.org/t/pattern-grammar-ambiguity/17158 "2022-08-10T02:37:31Z")

</div>

(previous discussion on URLO) The pattern grammar given in the reference has an ambiguity in it, which can lead to the compiler generating an unexpected error. Consider the case where you want to initialize a mutable v…

---

## [Rustdoc suggestion: Optionally show macro expansions (within a dropdown)](https://internals.rust-lang.org/t/rustdoc-suggestion-optionally-show-macro-expansions-within-a-dropdown/17133)

<div class="topic-metadata">

**Author:** [@tgross35](https://internals.rust-lang.org/u/tgross35)\
**Replies:** 2\
**Last updated:** [August 9, 2022, 4:52pm UTC](https://internals.rust-lang.org/t/rustdoc-suggestion-optionally-show-macro-expansions-within-a-dropdown/17133 "2022-08-09T16:52:53Z")

</div>

Hello all, Macros, especially proc macros, are pretty difficult to understand sometimes, and the source code isn't always intuitive to process what's going on. Something that could make this better is if rustdoc display…

---

## [Show deref's target methods, even if target is \`doc(hidden)\`](https://internals.rust-lang.org/t/show-derefs-target-methods-even-if-target-is-doc-hidden/17038)

<div class="topic-metadata">

**Author:** [@Shadlock0133](https://internals.rust-lang.org/u/Shadlock0133)\
**Replies:** 1\
**Last updated:** [July 19, 2022, 12:37am UTC](https://internals.rust-lang.org/t/show-derefs-target-methods-even-if-target-is-doc-hidden/17038 "2022-07-19T00:37:30Z")

</div>

Given such example: #\[doc(hidden)\] pub struct Impl; impl Impl { pub fn foo(&self); } pub struct ActuallyPublic { inner: Impl, } impl Deref for ActuallyPublic { type Target = Impl; fn deref(&self) -\> &…

---

## [Documentation: must vs should](https://internals.rust-lang.org/t/documentation-must-vs-should/16967)

<div class="topic-metadata">

**Author:** [@tczajka](https://internals.rust-lang.org/u/tczajka)\
**Replies:** 18\
**Last updated:** [July 14, 2022, 12:54pm UTC](https://internals.rust-lang.org/t/documentation-must-vs-should/16967 "2022-07-14T12:54:15Z")

</div>

Documentation of certain traits specify that implementations "must" do certain things. For instance, PartialEq says equality "must" be symmetric and transitive. Similarly for Eq, PartialOrd, Ord, Hash etc. I think this …

[Previous page](https://internals.rust-lang.org/c/documentation/14.md)

[Next page](https://internals.rust-lang.org/c/documentation/14.md?page=2)
