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

"Read more" shortening for trait impls chops off link references #49430

Closed
clarfonthey opened this issue Mar 27, 2018 · 2 comments · Fixed by #73819
Closed

"Read more" shortening for trait impls chops off link references #49430

clarfonthey opened this issue Mar 27, 2018 · 2 comments · Fixed by #73819
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@clarfonthey
Copy link
Contributor

Here's an example: https://doc.rust-lang.org/nightly/std/option/enum.Option.html#impl-Hash

If you notice here, because rustdoc naïvely chops off all lines of the doc but the first, link references get lost. While this particular instance will be solved by autolinking, this doesn't work if you link to something in general.

@clarfonthey
Copy link
Contributor Author

clarfonthey commented Apr 15, 2018

Managed to isolate this to fn shorter in librustdoc/html/render.rs. Going to try a PR soon.

…or not. I'm going to have to take a bit more of a look to understand the stuff surrounding plain_summary_line. It looks like a lot of it could use some refactoring.

@QuietMisdreavus QuietMisdreavus added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed T-rustdoc labels May 15, 2018
@XAMPPRocky XAMPPRocky added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jun 29, 2018
@euclio
Copy link
Contributor

euclio commented Feb 21, 2020

This is also present in the Windows CommandExt impl for std::process::Command: https://doc.rust-lang.org/std/process/struct.Command.html#implementations

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-enhancement Category: An issue proposing an enhancement or a PR with one. 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