about summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
2023-02-13Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, ↵Matthias Krüger-5/+5
r=GuillaumeGomez rustdoc: merge doctest tooltip with notable traits tooltip Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000 <details><summary>a user report where the tooltip arrow overlaps the text</summary> ![](https://cdn.discordapp.com/attachments/443150878111694848/1066420139530145812/this-example-is-not-tested-busted-rendering.png) </details> Fixes #91100 Preview: <https://notriddle.com/notriddle-rustdoc-demos/simplify-doctest-tooltip/std/vec/struct.Vec.html#indexing> Screenshot: ![image](https://user-images.githubusercontent.com/1593513/214975516-72667632-4609-49fa-8c37-e8d2ba1ba7dc.png)
2023-02-12Rollup merge of #107934 - ↵Matthias Krüger-0/+6
notriddle:notriddle/intra-doc-link-meta-description, r=camelid,GuillaumeGomez rustdoc: account for intra-doc links in `<meta name="description">` Similar to #86451, but for the SEO descriptions instead of the search descriptions.
2023-02-11rustdoc: account for intra-doc links in `<meta name="description">`Michael Howell-0/+6
2023-02-11Rollup merge of #107897 - GuillaumeGomez:reexported-macros-docs, r=notriddleMatthias Krüger-0/+23
Reexported macros docs Part of #59368 (doesn't fix it, only improve the current situation a bit). Macros were not correctly handled in reexports and the reexport attributes were not merged with the item either. This PR fixes both. r? `@notriddle`
2023-02-11Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, ↵Dylan DPC-27/+0
r=GuillaumeGomez rustdoc: remove inconsistently-present sidebar tooltips Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-02-10Add regression test for reexported macros docsGuillaume Gomez-0/+23
2023-02-09Rollup merge of #107655 - notriddle:notriddle/small-url-encode, r=GuillaumeGomezDylan DPC-14/+14
rustdoc: use the same URL escape rules for fragments as for examples Carries over improvements from #107284
2023-02-07rustdoc: simplify DOM for `.item-table`Michael Howell-43/+43
This switches from using `<div>` to the more semantic `<ul>`, and using class names that rhyme with the classes the search results table uses.
2023-02-07rustdoc: use a newline instead of `<br>` to format code headersMichael Howell-22/+47
Since these elements now use `white-space: pre-wrap` since 784665d4ce59c5239791f1f96fa2137e47ca1817, it's fine to use newlines for formatting, which is smaller and a bit less complicated.
2023-02-04rustdoc: trait bound formattingRoland Strasser-10/+44
rustdoc: fix item-spacer rustdoc: use proper comment style rustdoc: change formatting where clauses for traits rustdoc: remove semicolon from provided methods update provided methods formatting
2023-02-03rustdoc: use the same URL escape rules for fragments as for examplesMichael Howell-14/+14
2023-02-03Rollup merge of #107615 - notriddle:notriddle/nbsp, r=GuillaumeGomezMichael Goulet-5/+5
Replace nbsp in all rustdoc code blocks Based on #106125 by `@dtolnay` — this PR fixes the line wrapping bug. Fixes #106098. This makes code copyable from rustdoc rendered documentation into a Rust source file.
2023-02-03Replace nbsp in all rustdoc code blocksMichael Howell-5/+5
Co-Authored-By: David Tolnay <dtolnay@gmail.com>
2023-02-02Auto merge of #107000 - GuillaumeGomez:fix-items-in-doc-hidden-block, ↵bors-1/+95
r=notriddle,petrochenkov Fix handling of items inside a `doc(hidden)` block Fixes #106373. cc `@aDotInTheVoid` r? `@notriddle`
2023-01-31rustdoc: stop making unstable items transparentMichael Howell-5/+7
Fixes #93393
2023-01-31rustdoc: remove inconsistently-present sidebar tooltipsMichael Howell-27/+0
Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-01-31Rollup merge of #107479 - compiler-errors:probe-can-call-ocx, r=BoxyUwUYuki Okushi-0/+17
Use `ObligationCtxt::new_in_snapshot` in `satisfied_from_param_env` We can evaluate nested `ConstEvaluatable` obligations in an evaluation probe, which will ICE if we use `ObligationCtxt::new`. Fixes #107474 Fixes #106666 r? `@BoxyUwU` but feel free to reassign cc `@JulianKnodt` who i think added this assertion code Not sure if the rustdoc test is needed, but can't hurt. They're the same root cause, though.
2023-01-30Use ObligationCtxt::new_in_snapshot in satisfied_from_param_envMichael Goulet-0/+17
2023-01-30rustdoc: remove unnecessary wrapper div.item-decl from HTMLMichael Howell-253/+253
2023-01-28rustdoc: remove unused class `has-srclink`Michael Howell-86/+86
Stopped being used in CSS with 73d0f7c7b68784f1db0a1f53855c20d118a7e8b0
2023-01-27Add rustdoc test to ensure that items into a `doc(hidden)` block are handled ↵Guillaume Gomez-0/+50
as expected
2023-01-27rustdoc: merge doctest tooltip with notable traits tooltipMichael Howell-5/+5
Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000 Fixes #91100
2023-01-27Update rustdoc/redirect testGuillaume Gomez-1/+2
2023-01-27Add regression test for impl blocks in const exprGuillaume Gomez-0/+43
2023-01-27Add regression test for #107350Guillaume Gomez-0/+18
2023-01-27Rollup merge of #107336 - notriddle:notriddle/import-item-module-item, ↵Yuki Okushi-18/+18
r=GuillaumeGomez rustdoc: remove mostly-unused CSS classes `import-item` and `module-item`
2023-01-27Rollup merge of #107284 - notriddle:notriddle/plus, r=jshaYuki Okushi-4/+4
rustdoc: use smarter encoding for playground URL The old way would compress okay with DEFLATE, but this version makes uncompressed docs smaller, which matters for memory usage and stuff like `cargo doc`. Try it out: <https://play.rust-lang.org/?code=fn+main()+{%0Alet+mut+v+=+Vec::new();%0Av.push(1+/+1);%0Aprintln!(%22{}%22,+v[0]);%0A}> In local testing, this change shrinks sample pages by anywhere between 4.0% and 0.031% $ du -b after.dir/std/vec/struct.Vec.html before.dir/std/vec/struct.Vec.html 759235 after.dir/std/vec/struct.Vec.html 781842 before.dir/std/vec/struct.Vec.html 100*((759235-781842)/781842)=-2.8 $ du -b after.dir/std/num/struct.Wrapping.html before.dir/std/num/struct.Wrapping.html 3194173 after.dir/std/num/struct.Wrapping.html 3204351 before.dir/std/num/struct.Wrapping.html 100*((3194173-3204351)/3204351)=-0.031 $ du -b after.dir/std/keyword.match.html before.dir/std/keyword.match.html 8151 after.dir/std/keyword.match.html 8495 before.dir/std/keyword.match.html 100*((8151-8495)/8495)=-4.0 Gzipped tarball sizes seem shrunk, but not by much. du -s before.tar.gz after.tar.gz 69600 before.tar.gz 69480 after.tar.gz 100*((69480-69600)/69600)=-0.17
2023-01-27Rollup merge of #107242 - notriddle:notriddle/title-ordering, r=GuillaumeGomezYuki Okushi-5/+5
rustdoc: make item links consistently use `title="{shortty} {path}"` The ordering in item tables was flipped in 3030cbea957adbd560bf2eaa34c1b8a56daee16a, making it inconsistent with the ordering in method signatures. Compare these (before this PR is merged): https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/render/print_item.rs#L455-L459 https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/format.rs#L903-L908
2023-01-26rustdoc: remove mostly-unused CSS classes import/module-itemMichael Howell-18/+18
2023-01-26rustdoc: use smarter encoding for playground URLMichael Howell-4/+4
The old way would compress okay with DEFLATE, but this version makes uncompressed docs smaller, which matters for memory usage and stuff like `cargo doc`. Try it out: <https://play.rust-lang.org/?code=fn+main()+{%0Alet+mut+v+=+Vec::new();%0Av.push(1+/+1);%0Aprintln!(%22{}%22,+v[0]);%0A}> In local testing, this change shrinks sample pages by anywhere between 4.0% and 0.031% $ du -b after.dir/std/vec/struct.Vec.html before.dir/std/vec/struct.Vec.html 759235 after.dir/std/vec/struct.Vec.html 781842 before.dir/std/vec/struct.Vec.html 100*((759235-781842)/781842)=-2.8 $ du -b after.dir/std/num/struct.Wrapping.html before.dir/std/num/struct.Wrapping.html 3194173 after.dir/std/num/struct.Wrapping.html 3204351 before.dir/std/num/struct.Wrapping.html 100*((3194173-3204351)/3204351)=-0.031 $ du -b after.dir/std/keyword.match.html before.dir/std/keyword.match.html 8151 after.dir/std/keyword.match.html 8495 before.dir/std/keyword.match.html 100*((8151-8495)/8495)=-4.0 Gzipped tarball sizes seem shrunk, but not by much. du -s before.tar.gz after.tar.gz 69600 before.tar.gz 69480 after.tar.gz 100*((69480-69600)/69600)=-0.17
2023-01-23rustdoc: rearrange HTML in primitive reference linksMichael Howell-4/+4
This patch avoids hard-to-click single character links by making the generic part of the link: Before: <a href="#">&</a>T After: <a href="#">&T</a>
2023-01-23rustdoc: make item links consistently use `title="{shortty} {path}"`Michael Howell-5/+5
The ordering in item tables was flipped in 3030cbea957adbd560bf2eaa34c1b8a56daee16a, making it inconsistent with the ordering in method signatures. Compare these: https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/render/print_item.rs#L455-L459 https://github.com/rust-lang/rust/blob/c8e6a9e8b6251bbc8276cb78cabe1998deecbed7/src/librustdoc/html/format.rs#L903-L908
2023-01-19Revert "Add regression test for impl blocks in const expr"Guillaume Gomez-43/+0
This reverts commit 9cce0bc583ee2cff88935ce0e08d8ec1eb1239a8.
2023-01-18Auto merge of #106952 - petrochenkov:docglob, r=notriddle,GuillaumeGomezbors-0/+7
rustdoc: Fix glob import inlining Filter away names that are not actually imported by the glob, e.g. because they are shadowed by something else. Fixes the issue found in https://github.com/rust-lang/rust/pull/94857#issuecomment-1382912356.
2023-01-17Rollup merge of #106869 - notriddle:notriddle/item-decl-pre-rust, ↵Matthias Krüger-193/+193
r=GuillaumeGomez rustdoc: remove redundant item kind class from `.item-decl > pre` This class originated in the very first commit of `rustdoc_ng`, and was used to add a color border around the item decl based on its kind. https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L102-L106 The item decl no longer has a border, and there aren't any kind-specific styles in modern rustdoc's rendering of this UI item. Most of this PR is updating test cases so that they use `item-decl` to find the `<pre>` tag instead of relying on the fact that the class name had `rust {kind}` in it while other `<pre>` tags only had class `rust`.
2023-01-17rustdoc: Fix glob import inliningVadim Petrochenkov-0/+7
Filter away names that are not actually imported by the glob, e.g. because they are shadowed by something else
2023-01-14rustdoc: remove redundant item kind class from `.item-decl > pre`Michael Howell-193/+193
This class originated in the very first commit of `rustdoc_ng`, and was used to add a color border around the item decl based on its kind. https://github.com/rust-lang/rust/blob/4fd061c426902b0904c65e64a3780b21f9ab3afb/src/rustdoc_ng/html/static/main.css#L102-L106 The item decl no longer has a border, and there aren't any kind-specific styles in modern rustdoc's rendering of this UI item. Most of this commit is updating test cases so that they use `item-decl` to find the `<pre>` tag instead of relying on the fact that the class name had `rust {kind}` in it while other `<pre>` tags only had class `rust`.
2023-01-14Rollup merge of #106828 - notriddle:notriddle/notable-trait-docblock, ↵Matthias Krüger-5/+5
r=GuillaumeGomez rustdoc: remove `docblock` class from notable trait popover This commit builds on b72de9be74dd5ac1d8b23d5ece03a7690274a14c, which removes the `docblock` class from the All Items page, and 9457380ac902db3febf92077c5b645db55998ad4, which removes the `docblock` class from the item decl. Fixes #92974
2023-01-14Rollup merge of #106819 - notriddle:notriddle/rm-h1-fqn, r=GuillaumeGomezYuki Okushi-7/+7
rustdoc: remove unnecessary DOM class `h1.fqn` It's misleading. The main heading sometimes isn't an fully qualified name at all. It's also redundant. It's always a child of `div.main-heading`, so just use that.
2023-01-13rustdoc: remove `docblock` class from notable trait popoverMichael Howell-5/+5
This commit builds on b72de9be74dd5ac1d8b23d5ece03a7690274a14c, which removes the `docblock` class from the All Items page, and 9457380ac902db3febf92077c5b645db55998ad4, which removes the `docblock` class from the item decl. Fixes #92974
2023-01-13rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggleMichael Howell-40/+40
This swaps things around so that the class that gets used more often has the shorter name.
2023-01-13rustdoc: remove unnecessary DOM class `h1.fqn`Michael Howell-7/+7
It's misleading. The main heading sometimes isn't an fully qualified name at all. It's also redundant. It's always a child of `div.main-heading`, so just use that.
2023-01-13Rollup merge of #106741 - GuillaumeGomez:reexport-doc-hidden, r=notriddleYuki Okushi-0/+26
Fix reexport of `doc(hidden)` item Part of #59368. It doesn't fix the `doc(inline)` nor the `doc(hidden)` on macro. I'll do it in a follow-up PR. r? `@notriddle`
2023-01-12Add test for displayed re-export of `doc(hidden)`Guillaume Gomez-0/+26
2023-01-12Fix rendering 'const' for intrinsicsclubby789-0/+25
2023-01-11Move /src/test to /testsAlbert Larsan-0/+15735