Conversation
|
These commits modify Please ensure that if you've changed the output:
cc @obi1kenobi rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing |
|
rustbot has assigned @GuillaumeGomez. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
9c1da60 to
2f5048f
Compare
This comment has been minimized.
This comment has been minimized.
2f5048f to
fcbb219
Compare
This comment has been minimized.
This comment has been minimized.
fcbb219 to
605cfeb
Compare
This comment has been minimized.
This comment has been minimized.
605cfeb to
97e368b
Compare
This comment has been minimized.
This comment has been minimized.
97e368b to
e1cc402
Compare
This comment has been minimized.
This comment has been minimized.
8f06097 to
e13bbd3
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
e13bbd3 to
f672f66
Compare
This comment has been minimized.
This comment has been minimized.
a16baa4 to
e1059f3
Compare
This comment has been minimized.
This comment has been minimized.
Change the way Rustdoc behaves when a re-export and its original item both have doc comments. In other words, code like this: ```rust /// original struct Foo; /// re-export pub use Foo as Bar; ``` In the current version of Rustdoc, the rendering is equivalent to: ```rust /// re-export /// original pub use Bar; ``` Because there's no blank line between the comments, you get "re-export original" as a single paragraph. The new version, introduced by this pull request, renders two paragraphs. It actually runs the Markdown parser separately for both items, so link refdefs, footnotes, and, in the future, syntax features are scoped separately. This change is a pre-requisite for [LaTeX support](rust-lang#162365), because it introduces the notion of syntax features into Rustdoc's Markdown. It lets you turn tex_math_dollars support on and off. As part of this change, a bug related to intra-doc links is also fixed. This shows up when the reexport and the item both have intra-doc links with the same visible path, but where they resolve to different items. The bug is demonstrated in `tests/rustdoc-html/reexport/link-with-same-name-but-different-destination.rs`. The other test case changes demonstrate that this is, technically, a breaking change. When I ran [a Crater test](rust-lang#162169) for docs that rely on this behavior, though, it seemed most authors weren't relying on it.
e1059f3 to
4dd5eb4
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
View all comments
Change the way Rustdoc behaves when a re-export and its original item both have doc comments.
In other words, code like this:
In the current version of Rustdoc, the rendering is equivalent to:
Because there's no blank line between the comments, you get "re-export original" as a single paragraph.
The new version, introduced by this pull request, renders two paragraphs. It actually runs the Markdown parser separately for both items, so link refdefs, footnotes, and, in the future, syntax features are scoped separately.
This change is a pre-requisite for LaTeX support, because it introduces the notion of syntax features into Rustdoc's Markdown. It lets you turn tex_math_dollars support on and off.
As part of this change, a bug related to intra-doc links is also fixed. This shows up when the reexport and the item both have intra-doc links with the same visible path, but where they resolve to different items. The bug is demonstrated in
tests/rustdoc-html/reexport/link-with-same-name-but-different-destination.rs.The other test case changes demonstrate that this is, technically, a breaking change. When I ran a Crater test for docs that rely on this behavior, though, it seemed most authors weren't relying on it.