summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2022-08-08Add regression test commentNoah Lev-0/+2
2022-08-08Synthetize a trait ref when none is available.Camille GILLOT-1/+3
2022-08-08Avoid ICE in rustdoc.Camille GILLOT-0/+17
2022-08-08rustdoc: do not mark the contents of a skipped module as inlinedMichael Howell-0/+27
2022-08-03Rollup merge of #99738 - notriddle:notriddle/multiple-modules-w-same-name, ↵Dylan DPC-0/+41
r=camelid rustdoc: avoid inlining modules with duplicate names Fixes rust-lang/rust#99734
2022-08-02rustdoc: avoid inlining foreigns with duplicate namesMichael Howell-0/+20
2022-07-27Rollup merge of #99700 - est31:rustdoc_layout_heading, r=GuillaumeGomezYuki Okushi-0/+1
Add a clickable link to the layout section The layout section (activated by `--show-type-layout`) is currently not linkable to (outside of chrome's link to text feature). This PR makes it linkable via `#layout`.
2022-07-26Simplify testest31-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-07-25rustdoc: avoid inlining modules with duplicate namesMichael Howell-0/+21
Fixes rust-lang/rust#99734
2022-07-25apply review suggestionsMaybe Waffle-1/+1
2022-07-25Add a clickable link to the layout sectionest31-0/+1
2022-07-24add backticksMaybe Waffle-1/+1
2022-07-24Add rustdoc test for `#[rustc_must_implement_one_of]`Maybe Waffle-0/+10
2022-07-22Rollup merge of #99393 - ↵Dylan DPC-4/+4
Logarithmus:feature/99255-omit-const-generic-suffixes, r=petrochenkov feat: omit suffixes in const generics (e.g. `1_i32`) Closes #99255
2022-07-19Auto merge of #98180 - notriddle:notriddle/rustdoc-fn, ↵bors-3/+3
r=petrochenkov,GuillaumeGomez Improve the function pointer docs This is #97842 but for function pointers instead of tuples. The concept is basically the same. * Reduce duplicate impls; show `fn (T₁, T₂, …, Tₙ)` and include a sentence saying that there exists up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`. https://notriddle.com/notriddle-rustdoc-test/std/primitive.fn.html
2022-07-19tests: fix `rustdoc` testsArtur Sinila-4/+4
2022-07-17rustdoc: extend `#[doc(tuple_variadic)]` to fn pointersMichael Howell-3/+3
The attribute is also renamed `fake_variadic`.
2022-07-16rustdoc: avoid inlining items with duplicate `(type, name)`Michael Howell-0/+70
Fixes #99221
2022-07-07Rollup merge of #98973 - GuillaumeGomez:inherent-impl-anchors, r=notriddleDylan DPC-0/+56
Remove (unused) inherent impl anchors This is something `@notriddle` realized a few days ago: we have unused anchors in the DOM. This PR removes them. You can test it [here](https://rustdoc.crud.net/imperio/inherent-impl-anchors/foo/index.html). r? `@notriddle`
2022-07-06Rollup merge of #98939 - GuillaumeGomez:rustdoc-disamb-impls, r=notriddleGuillaume Gomez-39/+39
rustdoc: Add more semantic information to impl IDs Take over of #92745. I fixed the last remaining issue for the links in the sidebar (mentioned by `@jsha)` and fixed the few links broken in the std/core docs. cc `@camelid` r? `@notriddle`
2022-07-06Rollup merge of #98911 - notriddle:notriddle/rustdoc-string-impl, ↵Guillaume Gomez-0/+12
r=GuillaumeGomez rustdoc: filter '_ lifetimes from ty::Generics Fixes a weirdly-rendered section of the std::string::String docs. Before: ![image](https://user-images.githubusercontent.com/1593513/177256873-20b9cf6e-2429-4865-853b-b269d74672f4.png) After: ![image](https://user-images.githubusercontent.com/1593513/177256900-ef3efd17-f624-40c5-af90-fe709ec034f2.png)
2022-07-06Add test for inherent impls anchorsGuillaume Gomez-0/+56
2022-07-05Rollup merge of #98256 - GuillaumeGomez:whitespace-where-clause, r=notriddleGuillaume Gomez-0/+111
Fix whitespace handling after where clause Fixes #97733. You can see the result [here](https://rustdoc.crud.net/imperio/whitespace-where-clause/doc/foo/index.html). r? `@jsha`
2022-07-05Add test for invalid whitespace display after where clauseGuillaume Gomez-0/+111
2022-07-05Update rustdoc testsGuillaume Gomez-17/+17
2022-07-05rustdoc: Add more semantic information to impl idspierwill-24/+24
Instead of generating `#impl`, `#impl-1`, etc., generate IDs like `#impl-Foo<M>`. Co-authored-by: Noah Lev <camelidcamel@gmail.com>
2022-07-05Rollup merge of #98856 - GuillaumeGomez:rustdoc-test-rm-fixme, r=Dylan-DPCDylan DPC-12/+2
Remove FIXME from rustdoc intra-doc test Removed the FIXME. For the `extern crate`, even if `pub` exported, its documentation wasn't rendered so there is no point in keeping it. r? ``@notriddle``
2022-07-04rustdoc: filter '_ lifetimes from ty::GenericsMichael Howell-0/+12
Fixes a weirdly-rendered section of the std::string::String docs.
2022-07-04Rollup merge of #98814 - fmease:minimal-fix-for-issue-97933, r=GuillaumeGomezMatthias Krüger-3/+160
rustdoc: Censor certain complex unevaluated const exprs Fixes #97933. This is more of a hotfix for the aforementioned issue. By that, I mean that my proposed patch is not the best solution but one that does not change as much existing code. It treats symptoms rather than the root cause. This PR “censors” certain complex unevaluated constant expressions like `match`es, blocks, function calls, struct literals etc. by pretty-printing them as `_` / `{ _ }` (number and string literals, paths and `()` are still printed as one would expect). Resorting to this placeholder is preferable to printing the full expression verbatim since they can be quite large and verbose resulting in an unreadable mess in the generated documentation. Further, mindlessly printing the const would leak private and `doc(hidden)` struct fields (#97933), at least in the current stable & nightly implementations which rely on `span_to_snippet` (!) and `rustc_hir_pretty::id_to_string`. The censoring of _verbose_ expressions is probably going to stay longer term. However, in regards to private and `doc(hidden)` struct fields, I have a more proper fix in mind which I have already partially implemented locally and for which I am going to open a separate PR sometime soon. For that, I was already in contact with `@GuillaumeGomez.` The proper fix involves rustdoc not falling back on pretty-printing unevaluated consts so easily (what this PR is concerned about) and instead preferring to print evaluated consts which contain more information allowing it to selectively hide private and `doc(hidden)` fields, create hyperlinks etc. generally making the output more granular and precise (compared to the brutal `_` placeholder). Unfortunately, I was a bit too late and the issue just hit stable (1.62). Should this be backported to beta or even a potential 1.62.1? r? `@GuillaumeGomez`
2022-07-04rustdoc: censor certain complex unevaluated const exprsLeón Orell Valerian Liehr-3/+160
2022-07-04Rollup merge of #98806 - GuillaumeGomez:decl-trailing-whitespace, r=notriddleMatthias Krüger-1/+38
Fix long declaration trailing whitespace Fixes https://github.com/rust-lang/rust/issues/98803. Interestingly enough, it even simplifies the code a bit. r? `@notriddle`
2022-07-03Add test for trailing whitespace in long declarationGuillaume Gomez-1/+38
2022-07-03Remove FIXME from rustdoc intra-doc testGuillaume Gomez-12/+2
2022-07-01Shorten def_span for more items.Camille GILLOT-6/+6
2022-06-30rustdoc: filter '_ lifetimes from ty::PolyTraitRefMichael Howell-0/+22
Fixes #98697
2022-06-26Add regression test for #92859Guillaume Gomez-0/+24
2022-06-20Add test for macro support in "jump to def" featureGuillaume Gomez-0/+25
2022-06-19Rollup merge of #98105 - notriddle:notriddle/tuple-links, r=jshaDylan DPC-0/+18
rustdoc: remove tuple link on round braces This is #98069 but for tuples. The reasoning is the same: * This PR also changes it so that tuples with all-generic elements still link to the primitive.tuple.html page, just like slices. So there still plenty of on-ramps for anybody who doesn't know about it. * It's too hard to see when round braces are a separate link from the type inside of them. * It's too hard to click even if you do notice them. Before: * impl [ToSocketAddrs](https://doc.rust-lang.org/nightly/std/net/trait.ToSocketAddrs.html) for [(](https://doc.rust-lang.org/nightly/std/primitive.tuple.html)[IpAddr](https://doc.rust-lang.org/nightly/std/net/enum.IpAddr.html), [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html)[)](https://doc.rust-lang.org/nightly/std/primitive.tuple.html) * impl<K, V> [FromIterator](https://notriddle.com/notriddle-rustdoc-test/std/iter/trait.FromIterator.html)<[(](https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html)K, V[)](https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html)> for [BTreeMap](https://notriddle.com/notriddle-rustdoc-test/std/collections/struct.BTreeMap.html)<K, V> After: * impl [ToSocketAddrs](https://doc.rust-lang.org/nightly/std/net/trait.ToSocketAddrs.html) for ([IpAddr](https://doc.rust-lang.org/nightly/std/net/enum.IpAddr.html), [u16](https://doc.rust-lang.org/nightly/std/primitive.u16.html)) * impl<K, V> [FromIterator](https://notriddle.com/notriddle-rustdoc-test/std/iter/trait.FromIterator.html)<[(K, V)](https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html)> for [BTreeMap](https://notriddle.com/notriddle-rustdoc-test/std/collections/struct.BTreeMap.html)<K, V>
2022-06-18Add test cases for tuples with linksMichael Howell-0/+18
2022-06-16Auto merge of #97842 - notriddle:notriddle/tuple-docs, r=jsha,GuillaumeGomezbors-0/+54
Improve the tuple and unit trait docs * Reduce duplicate impls; show only the `(T,)` and include a sentence saying that there exists ones up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`. Here's the new version: * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html> * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.unit.html>
2022-06-16Exclude cfg "doc" and "doctest" from feature `doc_auto_cfg`Sprite-10/+15
2022-06-16Fix `cfg(not)` and `cfg(all)` causing Rustdoc stab to disappearSprite-1/+17
2022-06-14rustdoc: add test case for "variadic tuple" search notationMichael Howell-0/+18
2022-06-13rustdoc: remove link on slice bracketsMichael Howell-3/+3
Since #97668 was merged, the slice::get function now looks like this: ![image](https://user-images.githubusercontent.com/1593513/173430685-1dd2b275-2439-4392-b7d4-96bcb355a377.png) That whole thing, `[T]`, is a single link to `primitive.slice.html`. This definitely fixes it for this case, but it's not obvious what we should do for slices of concrete types: ![image](https://user-images.githubusercontent.com/1593513/173430968-7eed1aec-b688-4f84-a492-9210aff0037a.png) There are actually three links in that `[u8]`: the opening brace `[` is a link to `primitive.slice.html`, the `u8` is a link to `primitive.u8.html`, and the final `]` is a link to `primitive.slice.html`. This is a serious [usability bug](https://usability.yale.edu/web-accessibility/articles/links): the square braces are much too small for anyone who doesn't have perfect motor control using mouse or touch, provide an excessive number of tab stops for anyone using keyboard, and no visual indication whatsoever that they're separate links. Now that slices of generic types are linked, it seems reasonable to err on the side of less clutter and stop linking concrete slices to the slice page.
2022-06-11Add test case for #trait-implementations-1 linkMichael Howell-0/+8
2022-06-08Add regression test for #84634Guillaume Gomez-0/+28
2022-06-07rustdoc: show auto/blanket docs for tuple and unitMichael Howell-0/+28
2022-06-06Rollup merge of #90905 - GuillaumeGomez:empty-impl-blocks, r=jshaMatthias Krüger-0/+20
Add empty impl blocks if they have documentation Fixes https://github.com/rust-lang/rust/issues/90866. The update for the test script is needed to count the number of impl blocks we have with only the struct. To be noted that with https://github.com/rust-lang/rust/pull/89676 merged, it wouldn't be needed (I don't know what is the status of it btw. cc ```@Mark-Simulacrum).``` It looks like this: ![Screenshot from 2021-11-14 16-51-28](https://user-images.githubusercontent.com/3050060/141689100-e57123c0-bf50-4c42-adf5-d991e169a0e4.png) cc ```@jyn514``` r? ```@camelid```
2022-06-03Rollup merge of #97668 - notriddle:notriddle/slice-link, r=jshaDylan DPC-0/+32
rustdoc: clean up primitive.slice.html links Before: <a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html">Box</a>&lt;<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">[</a>T<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">]</a>&gt; After: <a href="https://doc.rust-lang.org/stable/std/boxed/struct.Box.html">Box</a>&lt;<a href="https://doc.rust-lang.org/stable/std/primitive.slice.html">[T]</a>&gt;
2022-06-02rustdoc: clean up primitive.slice.html linksMichael Howell-0/+32