about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
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-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``
2022-07-10Group .test-arrow CSS rules and fix rgb/rgba propertyGuillaume Gomez-7/+3
2022-07-10Rollup merge of #99086 - GuillaumeGomez:search-result-crate-filter-dropdown, ↵Matthias Krüger-1/+2
r=notriddle Fix display of search result crate filter dropdown In case a crate name is too long, the `<select>` completely overflows its parent. Another problem is that there is left margin on the `select` which break the alignment. You can see both issues here: ![Screenshot from 2022-07-09 15-31-12](https://user-images.githubusercontent.com/3050060/178108959-0eb5af19-ec60-4d34-a2fd-c27147683c78.png) And with the fix: ![Screenshot from 2022-07-09 15-33-37](https://user-images.githubusercontent.com/3050060/178108980-71030a92-84ee-4ee5-98e3-f97d03a6fbaf.png) cc `@jsha` r? `@notriddle`
2022-07-09Fix display of search result crate filter dropdownGuillaume Gomez-1/+2
2022-07-08add opt in attribute for stable-in-unstable itemsJane Lusby-1/+1
2022-07-08set all padding for main element in printInfra-1/+1
2022-07-08try to fix tidy issuesInfra-10/+10
2022-07-08improve print stylesInfra-1/+11
this change removes some interactive elements in `@media print` form. more specifically, it removes the source links, the expand/collapse toggle buttons, and the `#copy-path` button. it also adjusts some spacing and removes the `.top-doc` description completely if it's currently collapsed.
2022-07-07Rollup merge of #99017 - GuillaumeGomez:rustdoc-ending-enum, r=notriddleMatthias Krüger-17/+23
Replace boolean argument for print_where_clause with an enum to make code more clear As you suggested ``@notriddle.`` Just not sure if the naming seems good to you? r? ``@notriddle``
2022-07-07Replace boolean argument for print_where_clause with an enum to make code ↵Guillaume Gomez-17/+23
more clear
2022-07-07Rollup merge of #98973 - GuillaumeGomez:inherent-impl-anchors, r=notriddleDylan DPC-4/+16
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-42/+20
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-06Don't generate anchors on inherent impl methodsGuillaume Gomez-4/+16
2022-07-05Rollup merge of #98256 - GuillaumeGomez:whitespace-where-clause, r=notriddleGuillaume Gomez-14/+45
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-05Fix invalid add of whitespace when there is where clauseGuillaume Gomez-14/+45
2022-07-05Fix link generation in the sidebar for implsGuillaume Gomez-15/+12
2022-07-05rustdoc: Add more semantic information to impl idspierwill-27/+8
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 #98776 - notriddle:notriddle/mobile-sidebar-auto-close, ↵Dylan DPC-2/+24
r=GuillaumeGomez rustdoc: improve click behavior of the source code mobile full-screen "sidebar" On desktop, if you open the source code sidebar, it stays open even when you move from page to page. It used to do the same thing on mobile, but I think that's stupid. Since the file list fills the entire screen on mobile, and you can't really do anything with the currently selected file other than dismiss the "sidebar" to look at it, it's safe to assume that anybody who clicks a file in that list probably wants the list to go away so they can see it. Split out separately from #98772
2022-07-04Rollup merge of #98898 - GuillaumeGomez:new-eslint-rul, r=Dylan-DPCMatthias Krüger-0/+1
Add "no-div-regex" eslint rule r? `@Dylan-DPC`
2022-07-04Rollup merge of #98814 - fmease:minimal-fix-for-issue-97933, r=GuillaumeGomezMatthias Krüger-1/+12
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-1/+12
2022-07-04Add "no-div-regex" eslint ruleGuillaume Gomez-0/+1
2022-07-04Rollup merge of #98806 - GuillaumeGomez:decl-trailing-whitespace, r=notriddleMatthias Krüger-8/+4
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-04Rollup merge of #98774 - notriddle:notriddle/source-code-sidebar-button, ↵Matthias Krüger-6/+22
r=GuillaumeGomez rustdoc: make source sidebar toggle a real button This fixes tab focus, so that you can open and close the sidebar from keyboard. This should cause no visible change in appearance at all. The only way you'd know anything different is if you tried to use keyboard controls to open the source code file navigation sidebar. Separated out from #98772
2022-07-03Rollup merge of #98773 - notriddle:notriddle/source-sidebar-details, ↵Ralf Jung-52/+32
r=GuillaumeGomez rustdoc: use <details> tag for the source code sidebar This fixes the extremely poor accessibility of the old system, making it possible to navigate the sidebar by keyboard, and also implicitly gives the sidebar items the correct ARIA roles. Split out separately from #98772
2022-07-03Remove redundant pseudo-classMichael Howell-1/+1
2022-07-02rustdoc: add test case for background color of the sidebar toggle buttonMichael Howell-1/+1
2022-07-02rustdoc: add explanatory comment to `width: 100%` lineMichael Howell-0/+1
2022-07-02rustdoc: make source sidebar toggle a real buttonMichael Howell-6/+21
This fixes tab focus, so that you can open and close the sidebar from keyboard.
2022-07-02Remove unwanted trailing whitespaces for long declarationsGuillaume Gomez-8/+4
2022-07-01rustdoc: add spacing to the source view sidebarMichael Howell-1/+5
https://user-images.githubusercontent.com/1593513/176974336-20cecdc3-1885-402a-a6d5-81a8dd03a45d.png