about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2022-06-19Rollup merge of #98230 - GuillaumeGomez:weird-js-condition, r=notriddleMatthias Krüger-4/+1
Fix weird js condition While going around the code, I found this weird condition. Fixing also affects the generated results in some cases apparently (could only find this one). Any idea maybe `@notriddle?` r? `@notriddle`
2022-06-19Rollup merge of #98229 - GuillaumeGomez:eslint-checks, r=Dylan-DPCMatthias Krüger-0/+2
Add new eslint checks r? ```@Dylan-DPC```
2022-06-19Rollup merge of #98165 - WaffleLapkin:once_things_renamings, r=m-ou-seMatthias Krüger-1/+1
once cell renamings This PR does the renamings proposed in https://github.com/rust-lang/rust/issues/74465#issuecomment-1153703128 - Move/rename `lazy::{OnceCell, Lazy}` to `cell::{OnceCell, LazyCell}` - Move/rename `lazy::{SyncOnceCell, SyncLazy}` to `sync::{OnceLock, LazyLock}` (I used `Lazy...` instead of `...Lazy` as it seems to be more consistent, easier to pronounce, etc) ```@rustbot``` label +T-libs-api -T-libs
2022-06-18Remove weird JS conditionGuillaume Gomez-4/+1
2022-06-18Adding new eslint checks:Guillaume Gomez-0/+2
* no-sequences * no-throw-literal
2022-06-16Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`Maybe Waffle-1/+1
2022-06-16Auto merge of #97842 - notriddle:notriddle/tuple-docs, r=jsha,GuillaumeGomezbors-3/+19
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-16Rollup merge of #98092 - GuillaumeGomez:fix-sidebar-items-expand-collapse, ↵Yuki Okushi-3/+3
r=notriddle Fix sidebar items expand collapse The collapse/expand event was not working for the items in the source code viewer sidebar (talking about these items: ![Screenshot from 2022-06-14 11-21-58](https://user-images.githubusercontent.com/3050060/173543346-af056928-e921-458f-b918-60f6fd0ecbde.png) ). This PR fixes it and adds a GUI test to prevent another regression. r? ```@notriddle```
2022-06-14rustdoc: change "variadic tuple" notation to look less like real syntaxMichael Howell-1/+1
2022-06-14rustdoc: remove tuple link on round bracesMichael Howell-10/+34
This is 682889fb06591c4245422b73b005c5d8ae2d0cad but for tuples. The reasoning is the same: * This commit 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.
2022-06-14Fix expand/collapse on source viewer sidebar foldersGuillaume Gomez-3/+3
2022-06-13rustdoc: remove link on slice bracketsMichael Howell-27/+2
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/+2
2022-06-11Fix incorrectly spelled "variadic"Michael Howell-1/+1
2022-06-11Add eslint rule "no-script-url"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-return-assign"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-multi-assign"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-mixed-operator"Guillaume Gomez-0/+1
2022-06-11Add eslint rule "no-lonely-if"Guillaume Gomez-0/+1
2022-06-09Auto merge of #97772 - GuillaumeGomez:minifier-update, r=notriddlebors-4/+6
Update minifier version to 0.2.1 This change and these changes come from an idea of `@camelid:` instead of creating a string, we just `write` the type into the file directly. I don't think it'll have a big impact on perf but it's still a potential small improvement. r? `@notriddle`
2022-06-08rustdoc: show tuple impls as `impl Trait for (T, ...)`Michael Howell-3/+17
This commit adds a new unstable attribute, `#[doc(tuple_varadic)]`, that shows a 1-tuple as `(T, ...)` instead of just `(T,)`, and links to a section in the tuple primitive docs that talks about these.
2022-06-07Update minifier version to 0.2.1Guillaume Gomez-4/+6
2022-06-07Rollup merge of #97792 - GuillaumeGomez:eslint-checks, r=Dylan-DPCMatthias Krüger-1/+7
More eslint checks Here is the list of newly added eslint checks: * [no-confusing-arrow](https://eslint.org/docs/rules/no-confusing-arrow) * [no-div-regex](https://eslint.org/docs/rules/no-div-regex) * [no-floating-decimal](https://eslint.org/docs/rules/no-floating-decimal) * [no-implicit-globals](https://eslint.org/docs/rules/no-implicit-globals) * [no-implied-eval](https://eslint.org/docs/rules/no-implied-eval) * [no-label-var](https://eslint.org/docs/rules/no-label-var) Since you already reviewed the previous ones: r? `@Dylan-DPC`
2022-06-06Add "no-label-var" eslint checkGuillaume Gomez-0/+1
2022-06-06Add "no-implied-eval" eslint checkGuillaume Gomez-0/+1
2022-06-06Add "no-implicit-globals" eslint checkGuillaume Gomez-0/+1
2022-06-06Add "no-floating-decimal" eslint checkGuillaume Gomez-0/+1
2022-06-06Add "no-div-regex" eslint checkGuillaume Gomez-0/+1
2022-06-06Add "no-confusing-arrow" eslint checkGuillaume Gomez-1/+2
2022-06-06Rollup merge of #90905 - GuillaumeGomez:empty-impl-blocks, r=jshaMatthias Krüger-1/+14
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-04Don't generate "Impls on Foreign Types" for stdJacob Hoffman-Andrews-4/+3
Hack: many traits and types in std are re-exported from core or alloc. In general, rustdoc is capable of recognizing these implementations as being on local types. However, in at least one case, rustdoc gets confused and labels an implementation as being on a foreign type. To make sure that confusion doesn't pass on to the reader, consider all implementations in std, core, and alloc to be on local types.
2022-06-03Rollup merge of #97681 - GuillaumeGomez:more-eslint, r=Dylan-DPCDylan DPC-0/+8
Add more eslint checks A new batch of eslint rules: * [no-fallthrough](https://eslint.org/docs/rules/no-fallthrough) * [no-invalid-regexp](https://eslint.org/docs/rules/no-invalid-regexp) * [no-import-assign](https://eslint.org/docs/rules/no-import-assign) * [no-self-compare](https://eslint.org/docs/rules/no-self-compare) * [no-template-curly-in-string](https://eslint.org/docs/rules/no-template-curly-in-string) * [block-scoped-var](https://eslint.org/docs/rules/block-scoped-var) * [guard-for-in](https://eslint.org/docs/rules/guard-for-in) * [no-alert](https://eslint.org/docs/rules/no-alert) r? ``@notriddle``
2022-06-03Add "no-alert" eslint ruleGuillaume Gomez-0/+1
2022-06-03Add "guard-for-in" eslint ruleGuillaume Gomez-0/+1
2022-06-03Add "block-scoped-var" eslint ruleGuillaume Gomez-0/+1
2022-06-03Add "no-template-curly-in-string" eslint ruleGuillaume Gomez-0/+1
2022-06-03Add "no-self-compare" eslint ruleGuillaume Gomez-0/+1
2022-06-03Add "no-import-assign" eslint ruleGuillaume Gomez-0/+1
2022-06-03Add "no-invalid-regexp" eslint ruleGuillaume Gomez-0/+1
2022-06-03Add "no-fallthrough" eslint ruleGuillaume Gomez-0/+1
2022-06-02rustdoc: clean up primitive.slice.html linksMichael Howell-22/+16
2022-06-02Rollup merge of #97613 - jsha:implementation-is-on-local-type, r=GuillaumeGomezYuki Okushi-6/+3
rustdoc: Improve calculation of "Impls on Foreign Types" The existing code to calculate whether an implementation was on a "Foreign Type" was duplicated across the sidebar generation and the page generation. It also came to the wrong conclusion for some cases where both the trait and the "for" type were re-exports. This PR extracts the logic into a method of `Impl`, breaks it into a multi-line method so it can be commented, and adds a case for when the trait and the "for" type came from the same crate. This fixes some cases - like the platform-specific integer types (`__m256`, `__m128`, etc). But it doesn't fix all cases. See the screenshots below. [Before](https://doc.rust-lang.org/nightly/std/clone/trait.Clone.html#foreign-impls): <img src="https://user-images.githubusercontent.com/220205/171338226-59ce6daf-3d76-4bad-bc8d-72a8259a8f43.png" width=200> [After](https://rustdoc.crud.net/jsha/implementation-is-on-local-type/std/clone/trait.Clone.html): <img src="https://user-images.githubusercontent.com/220205/171338147-28308a65-1597-4223-be47-9550062404dd.png" width=200> The remaining types (`CString`, `NulError`, etc) are all from the `alloc` crate, while the `Clone` trait is from the `core` crate. Since `CString` and `Clone` are both re-exported by `std`, they are logically local to each other, but I couldn't figure out a good way to detect that in this code. I figure this is still a good step forward. Related: #97610 r? `@camelid`
2022-06-01Improve calculation of "Impls on Foreign Types"Jacob Hoffman-Andrews-6/+3
2022-05-31rustdoc: also index raw pointersMichael Howell-2/+3
Co-authored-by: Noah Lev <camelidcamel@gmail.com>
2022-05-31rustdoc: also index impl traitMichael Howell-6/+24
2022-05-31Fix theme checksGuillaume Gomez-0/+3
2022-05-31Display empty impl blocks if they have documentationsGuillaume Gomez-1/+11
2022-05-31Rollup merge of #97089 - GuillaumeGomez:improve-settings-theme-display, r=jshaDylan DPC-47/+117
Improve settings theme display This is a follow-up of #96958. In this PR, I changed how the theme radio buttons are displayed and improved their look as well. It now looks like this: ![Screenshot from 2022-05-17 20-46-20](https://user-images.githubusercontent.com/3050060/168887703-a01e3bd5-9644-4012-ac11-2ae7bacd6be6.png) ![Screenshot from 2022-05-17 20-46-12](https://user-images.githubusercontent.com/3050060/168887707-132f8b2d-1163-462f-b7dd-f861121bdee7.png) You can test it [here](https://rustdoc.crud.net/imperio/improve-settings-theme-display/doc/foo/index.html). r? `@jsha`
2022-05-30Fix invalid line number computation when clicking on something else than a ↵Guillaume Gomez-0/+4
line number
2022-05-30Fix display of `<details>`/`<summary>` in doc blocksGuillaume Gomez-10/+3