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

rustdoc should handle impls differently #3159

Closed
brson opened this issue Aug 9, 2012 · 11 comments
Closed

rustdoc should handle impls differently #3159

brson opened this issue Aug 9, 2012 · 11 comments
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@brson
Copy link
Contributor

brson commented Aug 9, 2012

Now that they are not named items, rustdoc should probably, beneath each type, have a section for the inherent methods and a section for implemented traits.

@catamorphism
Copy link
Contributor

Nominating for milestone 4 (well-covered).

@graydon
Copy link
Contributor

graydon commented Jun 13, 2013

just a bug, removing milestone/nomination.

@catamorphism
Copy link
Contributor

Bug triage. Should still be fixed.

@emberian
Copy link
Member

#8125

Fixed by rustdoc_ng

@orenbenkiki
Copy link

I like the fact I can write in my file:

/// Description of some group of functions (which isn't a trait).
impl MyType { ... }

#[test]
fn test_some_funcs() { ... }

/// Description of some other group of functions.
impl MyType { ... }

#[test]
fn test_more_funcs() { ... }

And then get in rustdoc to see each section separately as:

impl for MyType - Description of some group of functions (which isn't a trait).
impl for MyType - Description of some other group of functions.

This makes both the documentation and the source code more approachable, as each section has its own description and list of functions. The only problem is that rustdoc links all these sections in the index to the first one, which IMO is a bug.

Of course, any other way to group functions together in a section with description in the documentation would be fine, but this one seems pretty natural... what's the equivalent of the above in rustdoc-ng?

@emberian
Copy link
Member

@orenbenkiki the above works just fine as-is, and will be rendered similarly on the trait page.

@emberian
Copy link
Member

Now that rustdoc_ng has been merged, closing.

@orenbenkiki
Copy link

As long as the links to the sections would work - right now (in rustdoc) the anchor for impl MyType is simply implementation-for-MyType. This means if there's more than one, all the anchors and links are the same, and therefore the browser will always jump to the same (first) one, regardless on which one was clicked.

To fix that there would need to be some sequential index attached to each anchor (that is, implementation-for-My-Type-1, implementation-for-MyType-2, ...). Probably only attach the index for the 2nd link and onward, so that if there's only one entry the anchor will stay clean.

In principle this needs to be fixed in rustdoc. I guess I'll have to wait until rustdoc_ng will actually generate HTML to see if the problem will also exist there....

@huonw
Copy link
Member

huonw commented Sep 18, 2013

@orenbenkiki you can see what the output is like here: http://seld.be/rustdoc/master/std/index.html

@orenbenkiki
Copy link

Oh, right. Hmmm - I don't see an example of the pattern I posed above anywhere. I use it in my code, though... I just pulled the latest head - what flags do I need to give rustdoc_ng to generate HTML it would generate for my project, so I can see how it would look like? The --help flag isn't very helpful at the moment.

@orenbenkiki
Copy link

Ok, installed node, npm, rustdoc_web, run rustdoc on my code, looked at both the HTML and the JSON output...

It seems that rustdoc_ng does emit the required data (that is, the documentation of the separate impl sections) into the JSON file. However, the rustdoc_web completely ignores it, and there are no traces of it in the generated HTML.

So, in this respect, rustdoc_ng is worse than rustdoc - rustdoc has a bug in generating the correct links, but it at least generates the separate sections with the documentation and list of functions in each one...

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
The method trim_left_preserve_layout didn't handle tabs properly.
RalfJung pushed a commit to RalfJung/rust that referenced this issue Nov 12, 2023
Implement round.ps and round.pd SSE4.1 intrinsics

I had forgotten them.

I also increased the coverage of rounding tests to make sure the rounding direction is working as expected (e.g. test `1.25`, `1.5`, `1.75`...).
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Bumps [tests/perf/s2n-quic](https://github.com/aws/s2n-quic) from
`5f88e54` to `9730578`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/aws/s2n-quic/commit/9730578c0d562d80bbbe663161b3a5408ed3116c"><code>9730578</code></a>
chore: release 1.37.0 (<a
href="https://redirect.github.com/aws/s2n-quic/issues/2187">#2187</a>)</li>
<li><a
href="https://github.com/aws/s2n-quic/commit/b862ad982859f03d7e45f5d6291f749697a04a0f"><code>b862ad9</code></a>
s2n-quic-dc: initial commit (<a
href="https://redirect.github.com/aws/s2n-quic/issues/2185">#2185</a>)</li>
<li><a
href="https://github.com/aws/s2n-quic/commit/e0f224b848e725f94e7c9050ca1dfec16eb39bd8"><code>e0f224b</code></a>
feat(s2n-quic-core): allow forced PTO transmissions (<a
href="https://redirect.github.com/aws/s2n-quic/issues/2130">#2130</a>)</li>
<li><a
href="https://github.com/aws/s2n-quic/commit/bfb921daed2330c21202d441594a538458a3e5f2"><code>bfb921d</code></a>
feat(s2n-quic-core): Add ability to create an incremental reader
initialized ...</li>
<li><a
href="https://github.com/aws/s2n-quic/commit/23b07e41b6ead9621972cb0687fc3610540f7f77"><code>23b07e4</code></a>
feat(s2n-quic): allow disabling active connection migration support (<a
href="https://redirect.github.com/aws/s2n-quic/issues/2182">#2182</a>)</li>
<li>See full diff in <a
href="https://github.com/aws/s2n-quic/compare/5f88e549821518e71b550faf353a8b9970a29deb...9730578c0d562d80bbbe663161b3a5408ed3116c">compare
view</a></li>
</ul>
</details>
<br />


Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

6 participants