about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2022-09-01Add regression test for #101129Guillaume Gomez-0/+24
2022-09-01Auto merge of #100707 - dzvon:fix-typo, r=davidtwcobors-3/+3
Fix a bunch of typo This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31Update rustdoc testsGuillaume Gomez-52/+50
2022-08-31Fix a bunch of typoDezhi Wu-3/+3
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-31Add regression test for implementations displayed on reference primitive typeGuillaume Gomez-0/+37
2022-08-30Stabilize GATsJack Huey-3/+0
2022-08-27Rollup merge of #101018 - notriddle:notriddle/item-right-docblock-short, ↵Yuki Okushi-3/+1
r=GuillaumeGomez rustdoc: omit start/end tags for empty item description blocks Related to #100952 This is definitely not a complete solution, but it does shrink keysyms/index.html on smithay from 620K to 516K.
2022-08-26Rollup merge of #101006 - GuillaumeGomez:doc-cfg-reexport, r=notriddleGuillaume Gomez-0/+33
Fix doc cfg on reexports Fixes #83428. The problem was that the newly inlined item cfg propagation was not working since its real parent is different than its current one. For the implementation, I decided to put it directly into `CfgPropagation` instead of inside `inline.rs` because I thought it would be simpler to maintain and to not forget if new kind of items are added if it's all done in one place. r? `@notriddle`
2022-08-26Rollup merge of #100956 - GuillaumeGomez:reduce-rightside-dom-size, r=notriddleGuillaume Gomez-9/+9
Reduce right-side DOM size This is another follow-up of https://github.com/rust-lang/rust/pull/100429 but not in code blocks this time. So the idea is: if there is only one element in the `.rightside` element, there is no need to wrap it, we can just create one node. On each page, I run this JS: `document.getElementsByTagName('*').length`. Important to note: the bigger the number of elements inside the page, the greater the gain. It also doesn't work very nicely on std docs because there are a lot of version annotations. So with this PR, It allows to get the following results: | file name | before this PR | with this PR | diff | |-|-|-|-| | std/default/trait.Default.html | 2189 | 1331 | 39.2% | | std/vec/struct.Vec.html | 14073 | 13842 | 1.7% | | std/fmt/trait.Debug.html | 5313 | 4907 | 7.7% | | std/ops/trait.Index.html | 642 | 630 | 1.9% | | gtk4/WidgetExt | 3269 | 3061 | 6.4% | You can test it [here](https://rustdoc.crud.net/imperio/reduce-rightsize-dom-size/gtk4/prelude/trait.WidgetExt.html). r? `@notriddle`
2022-08-26Auto merge of #100705 - compiler-errors:issue-100620, r=oli-obkbors-0/+19
Avoid reporting overflow in `is_impossible_method` Fixes #100620 We're evaluating a new predicate in a different param-env than it was checked during typeck, so be more careful about handling overflow errors. Instead of using `FulfillmentCtxt`, using `InferCtxt::evaluate_obligation` by itself will give us back the overflow error, so we can throw it away properly. This may give us more false-positives, but it doesn't regress the `<HashMap as Iterator>::rev` example that originally motivated adding `is_impossible_method` in the first place.
2022-08-25rustdoc: omit start/end tags for empty item description blocksMichael Howell-3/+1
Related to #100952 This is definitely not a complete solution, but it does shrink keysyms/index.html on smithay from 620K to 516K.
2022-08-25Add test for missing cfg propagation for reexportGuillaume Gomez-0/+33
2022-08-24Update rustdoc tests for simplified rightside DOMGuillaume Gomez-9/+9
2022-08-21Rollup merge of #100775 - GuillaumeGomez:reduce-span-v2, r=notriddleMatthias Krüger-4/+6
rustdoc: Merge source code pages HTML elements together v2 This is the follow-up of https://github.com/rust-lang/rust/pull/100429. I strongly recommend to review it one commit at a time because otherwise it's a lot at once. For these ones, on each page, I run this JS: `document.getElementsByTagName('*').length`. The goal is to count the number of DOM elements. I took some pages that seemed big, but don't hesitate to check some others. I also added the "starting point" because it's quite nice to see how much the page was reduced thanks to these two PRs. | file name | before #100429 | before this PR | with this PR | diff | |-|-|-|-|-| | std/lib.rs.html (source link on std crate page) | 3455 | 2332 | 1772 | 24% | | alloc/vec/mod.rs.html (source on Vec type page) | 11012 | 5982 | 5833 | 2.5% | | alloc/string.rs.html (source on String type page) | 10800 | 6010 | 5822 | 3.2% | | std/sync/mutex.rs.html (source on Mutex type page) | 2953 | 2041 | 2038 | 0.1% | So unsurprisingly, the more attributes you have, the bigger the difference. You can test it [here](https://rustdoc.crud.net/imperio/reduce-span-v2/src/std/lib.rs.html). cc ``````@jsha`````` r? ``````@notriddle``````
2022-08-20Rollup merge of #100718 - GuillaumeGomez:fix-item-info, r=jshaMatthias Krüger-5/+9
[rustdoc] Fix item info display Fixes #100369. The solution I came up with was simply to wrap the "text part" of the `item-info` into another span so that `flex` wouldn't mess with it. Live demo is [here](https://rustdoc.crud.net/imperio/fix-item-info/foo/struct.ItemInfo.html). r? ``@jsha``
2022-08-20Update rustdoc testsGuillaume Gomez-4/+6
2022-08-18rustdoc: count deref and non-deref as same set of used methodsMichael Howell-0/+30
2022-08-18Update rustdoc testGuillaume Gomez-5/+9
2022-08-18Avoid overflow in is_impossible_methodMichael Goulet-0/+19
2022-08-14Update rustdoc testsGuillaume Gomez-9/+10
2022-08-13rustdoc: Fix incorrect usage of `@!has` and `@!matches`Noah Lev-22/+24
`@!has` (and `@!matches`) with two arguments used to treat the second argument as a literal string of HTML code. Now, that feature has been renamed into `@!hasraw` (and `@!matchesraw`), and the arity-2 `@!has` version is an error. These uses thought the second argument was being treated as an XPath, as with the arity-3 version, but in fact was being treated as literal HTML. Because these were checking for the *absence* of the string, the tests silently did nothing -- an XPath string won't ever be showing up in the test's generated HTML!
2022-08-13Update `@!has` name in testsNoah Lev-127/+127
2022-08-13Rename `@hastext` to `@hasraw` (same for `matches`)Noah Lev-168/+168
I think `@hasraw` is slightly clearer than `@hastext` since it is actually matching against the raw HTML, not the text nodes.
2022-08-13Update tests: arity-2 `@{has,matches}` -> `...text`Noah Lev-168/+168
2022-08-11rustdoc: don't generate DOM element for operatorJacob Hoffman-Andrews-4/+1
In our source page highlighting, we were generating `<span class="op">` tags for all "operators", including e.g. `<` `>` around generic parameters, `*`, `&`. This contributed significantly to DOM size, but we don't actually style `.op` except in the ayu theme. Remove the styles for `.op` in ayu, and stop generating the `<span>`s. This reduces DOM size of an example page[1] from 265,938 HTML elements to 242,165 elements, a 9% reduction. [1]: https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html
2022-08-10Rollup merge of #100348 - camelid:test-93205, r=jyn514Michael Goulet-0/+20
Add regression test for #93205 Closes #93205. This issue was most likely fixed by #93805.
2022-08-09Fix failing testNoah Lev-1/+1
For some reason, adding some text to match against makes this test pass. Before, when it was *more* general, it was failing! This seems very likely to be a bug in htmldocck, which I'm going to investigate.
2022-08-09Add regression test for #93205Noah Lev-0/+20
This issue was most likely fixed by #93805.
2022-08-10Rollup merge of #100323 - GuillaumeGomez:impl-blocks-only-private, r=notriddleMatthias Krüger-0/+84
[rustdoc] Don't render impl blocks with doc comment if they only contain private items by default Fixes #100001. cc `@jhpratt` r? `@notriddle`
2022-08-09Add test for impl blocks containing only private itemsGuillaume Gomez-0/+84
2022-08-09Rollup merge of #100221 - compiler-errors:impossible-trait-items, ↵Dylan DPC-0/+20
r=lcnr,notriddle,camelid Don't document impossible to call default trait items on impls Closes #100176 This only skips documenting _default_ trait items on impls, not ones that are written inside the impl block. This is a conservative approach, since I think we should document all items written in an impl block (I guess unless hidden or whatever), but the existence of this new query I added makes this easy to extend to other rustdoc cases.
2022-08-09Auto merge of #100205 - cjgillot:noice-doc, r=camelidbors-0/+21
Avoid ICE in rustdoc when using `Fn` bounds Fixes https://github.com/rust-lang/rust/issues/100143
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-07Don't document impossible to call default trait items on implsMichael Goulet-0/+20
2022-08-06rustdoc: do not mark the contents of a skipped module as inlinedMichael Howell-0/+27
2022-08-06Avoid ICE in rustdoc.Camille GILLOT-0/+17
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`.