about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2022-08-02Replace `* -> vec` with `-> vec` in docsNoah Lev-1/+1
Rustdoc's current syntax is `-> vec`.
2022-08-02rustdoc: use a more compact encoding for source-files.jsMichael Howell-20/+31
This reduces the compiler-doc file from 40K to 36K, a 10% reduction in size.
2022-08-02Rollup merge of #100005 - GuillaumeGomez:cleanup-ast-attr-clean, r=notriddleMatthias Krüger-1/+1
Remove Clean trait for ast::Attribute and improve Attributes::from_ast I prefer to keep this commit on its own for this PR because I'm changing a bit more things than expected originally: I split `Attributes::from_ast` into two because there is only one location making use of its second parameter. Follow-up of https://github.com/rust-lang/rust/pull/99638. r? `@notriddle`
2022-08-02Remove Clean trait implementation for ast::Attribute and cleanup ↵Guillaume Gomez-1/+1
Attributes::from_ast function by splitting it in two
2022-08-02Rollup merge of #99779 - GuillaumeGomez:fix-item-info-pos-and-height, ↵Matthias Krüger-1/+9
r=notriddle Fix item info pos and height Fixes https://github.com/rust-lang/rust/issues/98266. Fixes https://github.com/rust-lang/rust/issues/98343. You can test it [here](https://rustdoc.crud.net/imperio/fix-item-info-pos-and-height/lib2/trait.Trait.html). Here is a screenshot of the result: ![Screenshot from 2022-07-26 21-55-53](https://user-images.githubusercontent.com/3050060/181100624-18b8b045-5c25-4c7c-9c44-97d55d29b675.png) r? `@jsha`
2022-08-01Shrink `Token`.Nicholas Nethercote-1/+1
From 72 bytes to 12 bytes (on x86-64). There are two parts to this: - Changing various source code offsets from 64-bit to 32-bit. This is not a problem because the rest of rustc also uses 32-bit source code offsets. This means `Token` is no longer `Copy` but this causes no problems. - Removing the `RawStrError` from `LiteralKind`. Raw string literal invalidity is now indicated by a `None` value within `RawStr`/`RawByteStr`, and the new `validate_raw_str` function can be used to re-lex an invalid raw string literal to get the `RawStrError`. There is one very small change in behaviour. Previously, if a raw string literal matched both the `InvalidStarter` and `TooManyHashes` cases, the latter would override the former. This has now changed, because `raw_double_quoted_string` now uses `?` and so returns immediately upon detecting the `InvalidStarter` case. I think this is a slight improvement to report the earlier-detected error, and it explains the change in the `test_too_many_hashes` test. The commit also removes a couple of comments that refer to #77629 and say that the size of these types don't affect performance. These comments are wrong, though the performance effect is small.
2022-07-30Rollup merge of #99904 - GuillaumeGomez:cleanup-html-whitespace, r=notriddleYuki Okushi-19/+21
Cleanup html whitespace I realized while looking at the raw HTML that we generated some unwanted white space characters. This PR cleans up the one coming directly from rustdoc. I'll check from `pulldown-cmark` for the remaining ones. Some numbers now: the difference is small, it goes from `63009` to `62859`. But multiplied by the number of files, it becomes quite interesting overall. r? `@notriddle`
2022-07-29Box TypedefItem, ImplItem, AssocTypeItem variants of ItemKindest31-2/+2
This reduces ItemKind size from 224 bytes to 160 bytes.
2022-07-29Remove unwanted extra white space characters from HTMLGuillaume Gomez-19/+21
2022-07-28Rollup merge of #99810 - GuillaumeGomez:fix-settings-slider-small-width, ↵Dylan DPC-2/+1
r=notriddle Fix settings slider on small width screens Fixes #99794. Screenshot of the fix: ![Screenshot from 2022-07-27 14-17-08](https://user-images.githubusercontent.com/3050060/181250007-55f982d1-89db-45b7-a4f1-0d1729e6a3e3.png) cc `````@jsha````` r? `````@notriddle`````
2022-07-27Rollup merge of #99812 - GuillaumeGomez:fix-headings-colors, r=jsha,notriddleGuillaume Gomez-6/+2
Fix headings colors Fixes #99797. ![image](https://user-images.githubusercontent.com/3050060/181260966-49faf9d3-f6b8-4de4-bc7d-ed9f0467cf68.png) cc `@jsha` r? `@notriddle`
2022-07-27Fix headings borderGuillaume Gomez-5/+1
2022-07-27Fix invalid css property valueGuillaume Gomez-1/+1
2022-07-27Fix settings display on small screen sizeGuillaume Gomez-2/+1
2022-07-27Rollup merge of #99700 - est31:rustdoc_layout_heading, r=GuillaumeGomezYuki Okushi-1/+6
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-26Fix display of item info and unify their heightGuillaume Gomez-1/+9
2022-07-26Rollup merge of #99235 - ↵Matthias Krüger-6/+21
WaffleLapkin:rustdoc_implement_support_for_must_implement, r=GuillaumeGomez rustdoc: Add support for `#[rustc_must_implement_one_of]` This PR adds support for `#[rustc_must_implement_one_of]` attribute added in #92164. There is a desire to eventually use this attribute of `Read`, so making it show up in docs is a good thing. I "stole" the styling from cfg notes, not sure what would be a proper styling. Currently it looks like this: ![2022-07-14_15-00](https://user-images.githubusercontent.com/38225716/178968170-913c1dd5-8875-4a95-9848-b075a0bb8998.png) <details><summary>Code to reproduce</summary> <p> ```rust #![feature(rustc_attrs)] #[rustc_must_implement_one_of(a, b)] pub trait Trait { fn req(); fn a(){ Self::b() } fn b(){ Self::a() } } ``` </p> </details>
2022-07-25apply review suggestionsMaybe Waffle-1/+1
2022-07-25Add a clickable link to the layout sectionest31-1/+6
2022-07-25Fix sidebar background-color on mobileGuillaume Gomez-1/+0
2022-07-25fix rustdoc-gui testsMaybe Waffle-1/+1
2022-07-24Satisfy theme checkMaybe Waffle-0/+1
2022-07-24add backticksMaybe Waffle-2/+2
2022-07-24Add support for `#[rustc_must_implement_one_of]` to rustdocMaybe Waffle-7/+21
2022-07-22Auto merge of #99598 - GuillaumeGomez:clean-trait-fields-on-demand, r=notriddlebors-5/+5
Make some clean::Trait fields computation on demand r? `@notriddle`
2022-07-22Make some clean::Trait fields computation on demandGuillaume Gomez-5/+5
2022-07-22Rollup merge of #99423 - GuillaumeGomez:group-css-font-rule, r=notriddleDylan DPC-12/+9
Group CSS font rule Another CSS cleanup I came by when working on something else. r? ``@notriddle``
2022-07-21Rollup merge of #99559 - GuillaumeGomez:rm-unused-field-keyword, r=notriddleMatthias Krüger-2/+2
Remove unused field in ItemKind::KeywordItem For the keyword name, we use `Item::name` directly everywhere so there is no point into keeping it. r? ``@notriddle``
2022-07-21Remove unused field in ItemKind::KeywordItemGuillaume Gomez-2/+2
2022-07-20Rollup merge of #99489 - GuillaumeGomez:gui-fixes, r=notriddleMatthias Krüger-7/+22
rustdoc UI fixes The first commit fixes this bug: ![Screenshot from 2022-07-20 02-54-26](https://user-images.githubusercontent.com/3050060/179879053-fc34f27a-6248-4f5c-9fcb-80adbfc1598c.png) ![Screenshot from 2022-07-20 03-00-03](https://user-images.githubusercontent.com/3050060/179879056-1c0973a0-d535-44e7-a48e-bad692034467.png) The second one fixes the missing change of border color when the search input is focused. cc `@jsha` r? `@notriddle`
2022-07-20Remove CSS transition for search input border-colorGuillaume Gomez-1/+0
2022-07-20Fix CSS on search input focusGuillaume Gomez-3/+21
2022-07-20Fix crate filter select displayGuillaume Gomez-3/+1
2022-07-19Auto merge of #98180 - notriddle:notriddle/rustdoc-fn, ↵bors-1/+34
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-19Improve the function pointer docsMichael Howell-6/+26
* Reduce duplicate impls; show only the `fn (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`.
2022-07-18Group CSS font ruleGuillaume Gomez-12/+9
2022-07-17rustdoc: extend `#[doc(tuple_variadic)]` to fn pointersMichael Howell-1/+14
The attribute is also renamed `fake_variadic`.
2022-07-17Fix auto-expand of trees in source code page sidebarGuillaume Gomez-1/+1
2022-07-15Rollup merge of #99209 - GuillaumeGomez:crate-level-sidebar, r=jshaDylan DPC-18/+15
Correctly handle crate level page on docs.rs as well Fixes #99121. On docs.rs, they move the `class` attribute into a child which still has `rustdoc`. So instead of using the `<body>`, we can simply use this one directly. r? `@jsha`
2022-07-15Rollup merge of #99237 - GuillaumeGomez:rustdoc-css-cleanup, r=notriddleDylan DPC-48/+6
removed unused CSS and unused HTML IDs I think that should cover most remaining unused CSS/HTML IDs. r? `@notriddle`
2022-07-14Correctly handle crate level page on docs.rs as wellGuillaume Gomez-18/+15
2022-07-14Auto merge of #95956 - yaahc:stable-in-unstable, r=cjgillotbors-1/+1
Support unstable moves via stable in unstable items part of https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/moving.20items.20to.20core.20unstably and a blocker of https://github.com/rust-lang/rust/pull/90328. The libs-api team needs the ability to move an already stable item to a new location unstably, in this case for Error in core. Otherwise these changes are insta-stable making them much harder to merge. This PR attempts to solve the problem by checking the stability of path segments as well as the last item in the path itself, which is currently the only thing checked.
2022-07-14Removed unused HTML IDsGuillaume Gomez-2/+0
2022-07-14Remove unused CSSGuillaume Gomez-46/+6
2022-07-13Auto merge of #99203 - GuillaumeGomez:rollup-b2re0dv, r=GuillaumeGomezbors-163/+45
Rollup of 10 pull requests Successful merges: - #98789 (rustdoc-json-types: Clean up derives.) - #98848 (Build the Clippy book as part of x.py doc) - #99020 (check non_exhaustive attr and private fields for transparent types) - #99132 (Add some autolabels for A-bootstrap and T-infra) - #99148 (Clarify that [iu]size bounds were only defined for the target arch) - #99152 (Use CSS variables to handle theming (part 2)) - #99168 (Add regression test for #74713) - #99176 (:arrow_up: rust-analyzer) - #99183 (Mention rust-analyzer maintainers when `proc_macro` bridge is changed) - #99185 (llvm-wrapper: adapt for LLVM API change) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-07-13Auto merge of #99066 - est31:remove_box_librustdoc, r=jshabors-6/+8
Remove most box syntax from librustdoc This is the second attempt after the librustdoc specific changes have been reverted from #87781 in #89134, due to a minor, but exant regression caused by the changes. ~~There have been some changes to librustdoc in the past and maybe thanks to them there is no regression any more. If there is still a regression, one can investigate further and maybe find ways to fix the regressions. Thus, i request a perf run.~~ Edit: turns out there is still a regression, but it's caused only by a subset of the changes. So I've changed this PR to only contains the changes that don't cause any performance regressions, keeping the regression causing changes for a later PR.
2022-07-11Remove box syntax from Box<dyn Iterator> constructionest31-6/+8
The iterators created should be pretty light weight.
2022-07-11Continue themes CSS migration over CSS variablesGuillaume Gomez-130/+45
2022-07-11Remove unused CSS rulesGuillaume Gomez-33/+0
2022-07-11Rollup merge of #99114 - GuillaumeGomez:css-cleanup, r=Dylan-DPCMatthias Krüger-7/+3
Group .test-arrow CSS rules and fix rgb/rgba property Surprisingly, the web browsers were handling the `rgb`/`rgba` typo correctly. At least it now is as expected. For the rest, it's simply grouping `.test-arrow` rules. r? ``@Dylan-DPC``