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

links on first line of trait description are gone #38386

Closed
bluss opened this issue Dec 15, 2016 · 2 comments · Fixed by #73819
Closed

links on first line of trait description are gone #38386

bluss opened this issue Dec 15, 2016 · 2 comments · Fixed by #73819
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@bluss
Copy link
Member

bluss commented Dec 15, 2016

See for example doc for the method scan: https://docs.rs/rawslice/0.1.0/rawslice/struct.SliceIter.html#method.scan

The link at fold() is removed because only the first line is shown in the trait impl documentation.

@bluss bluss added A-docs T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Dec 15, 2016
@QuietMisdreavus
Copy link
Member

Hmm, from what I could tell by looking at the same method in std in various versions of the std docs, this probably hasn't worked for the trait function summaries since they were printed in the first place. The summary lines in modules can format links just fine, so I'll take a look and see if that code can be adapted to trait impl rendering.

@QuietMisdreavus
Copy link
Member

I could see "just render it so the link exists" backfiring because links are typically specified as relative links. This specific example would likely work because the link to fold() is specified as just the anchor ID, but I could easily see a summary line linking to a separate struct, or anywhere else within the crate. In that case, the relative link would be relative to the implementer, and it would create a broken link. It might be possible to strip the link out entirely, though. The code is trying to do that already, but it seems like the way it's passing the test to the Markdown renderer doesn't let it see that there's a link there.

@steveklabnik steveklabnik added T-tools and removed T-tools A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Mar 9, 2017
@steveklabnik steveklabnik added A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools and removed A-docs labels Mar 23, 2017
@steveklabnik steveklabnik added T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. and removed T-tools labels May 18, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 26, 2017
@frewsxcv frewsxcv removed the A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools label Aug 19, 2017
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 3, 2020
…illaumeGomez

rustdoc: do not use plain summary for trait impls

Fixes rust-lang#38386.
Fixes rust-lang#48332.
Fixes rust-lang#49430.
Fixes rust-lang#62741.
Fixes rust-lang#73474.

Unfortunately this is not quite ready to go because the newly-working links trigger a bunch of linkcheck failures. The failures are tough to fix because the links are resolved relative to the implementor, which could be anywhere in the module hierarchy.

(In the current docs, these links end up rendering as uninterpreted markdown syntax, so I don't think these failures are any worse than the status quo. It might be acceptable to just add them to the linkchecker whitelist.)

Ideally this could be fixed with intra-doc links ~~but it isn't working for me: I am currently investigating if it's possible to solve it this way.~~ Opened rust-lang#73829.

EDIT: This is now ready!
@bors bors closed this as completed in e0822ec Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-dev-tools Relevant to the dev-tools subteam, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants