about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-04-24Rollup merge of #84433 - GuillaumeGomez:search-input-blur, r=jshaYuki Okushi-3/+6
Prevent control, shift and alt keys to make search input lose focus Part of #84384. r? ````@jsha````
2021-04-24Rollup merge of #84321 - Swatinem:subvariant-details, r=GuillaumeGomezYuki Okushi-6/+17
rustdoc: Convert sub-variant toggle to HTML Instead of creating a JS toggle, this injects details/summary for sub-variants of enums. This also fixes the CSS so that the toggle button does not jump when expanding/collapsing. Takes inspiration from #83337 and should be considered part of #83332. Not quite sure if the `.sub-variant` selectors could be further simplified? AFAICS it is only used in that place, and that does not seem to allow any recursion.
2021-04-23improve wordingArpad Borsos-1/+1
2021-04-23Auto merge of #84457 - jyn514:cleanup-crate, r=GuillaumeGomezbors-132/+150
rustdoc: Remove most fields from ExternalCrate Once https://github.com/rust-lang/rust/issues/84304 is fixed, I can get rid of ExternCrate altogether in favor of CrateNum, but in the meantime, this shrinks ExternalCrate quite a lot. This might hurt compile-times; if it does, I can add `primitive` and `keyword` queries. I expect this to improve compilemem. Helps with https://github.com/rust-lang/rust/issues/76382. r? GuillaumeGomez
2021-04-23rustdoc: Implement `is_primitive` in terms of `primitive_type()`Joshua Nelson-8/+1
Previously, they disagreed about what types were primitives. This also fixes a bug where rustdoc would mark any type with a reference as a primitive.
2021-04-23Auto merge of #84445 - jyn514:hidden, r=<try>bors-6/+13
rustdoc: Hide `#text` in doc-tests Since `#![attr]` and `#[attr]` are the only valid syntax that start with `#`, we can just special case those two tokens. Fixes https://github.com/rust-lang/rust/issues/83284.
2021-04-22rustdoc: Stop special casing `broken_intra_doc_links` unnecessarilyJoshua Nelson-8/+1
2021-04-22Remove unnecessary item_name parameter to `mod_item_in`Joshua Nelson-11/+9
2021-04-22Remove unnecessary `item_name` parameter to `mod_item_out`Joshua Nelson-7/+5
2021-04-22Remove unnecessary `edition` field on SharedContextJoshua Nelson-9/+10
2021-04-22Remove unnecessary `edition` parameter to rendererJoshua Nelson-25/+6
2021-04-22Remove unnecessary `diag` parameter to `after_krate`Joshua Nelson-16/+10
2021-04-22Remove unnecessary `crate_name` parameter to `after_krate`Joshua Nelson-19/+7
It's always `tcx.crate_name(LOCAL_CRATE)`, it doesn't need to be passed in separately.
2021-04-22Remove `keywords` from ExternCrateJoshua Nelson-52/+57
2021-04-22Get rid of ExternCrate::primitivesJoshua Nelson-77/+77
2021-04-22Remove `name` field from ExternalCrateJoshua Nelson-7/+12
2021-04-22Remove src field from ExternCrateJoshua Nelson-6/+14
2021-04-22rustdoc: Hide `#text` in doc-testsJoshua Nelson-6/+13
Since `#![attr]` and `#[attr]` are the only valid syntax that start with `#`, we can just special case those two tokens.
2021-04-22Use flex more consistently.Tor Hovland-14/+8
2021-04-22Auto merge of #84420 - workingjubilee:microvec, r=Mark-Simulacrumbors-5/+5
Use arrayvec 0.7, drop smallvec 0.6 With the arrival of min const generics, many alt-vec libraries have updated to use it in some way and arrayvec is no exception. Use the latest with minor refactoring. Also, rustc_workspace_hack is the only user of smallvec 0.6 in the entire tree, so drop it.
2021-04-22Rollup merge of #84376 - torhovland:issue-84534, r=GuillaumeGomezDylan DPC-4/+9
Uses flex to fix formatting of h1 at any width Fixes #84354.
2021-04-22Prevent control, shift and alt keys to make search input lose focusGuillaume Gomez-3/+6
2021-04-21Use arrayvec 0.7, drop smallvec 0.6Jubilee Young-5/+5
With the arrival of min const generics, many alt-vec libraries have updated to use it in some way and arrayvec is no exception. Use the latest with minor refactoring. Also, rustc_workspace_hack is the only user of smallvec 0.6 in the entire tree, so drop it.
2021-04-21Replaced flex gap with margin, for compatibility with older browsers.Tor Hovland-1/+1
2021-04-20fix is_module checkSmitty-4/+4
2021-04-20Rename pushname to is_moduleSmitty-3/+3
2021-04-20Write Rustdoc titles like "x in crate::mod - Rust"Smitty-9/+8
This makes Rustdoc titles for items read like "x in cratename::blah::foo - Rust". Title for modules and other non-items are unchanged, and still read like "doccratenameconst::blah::foo - Rust". This makes managing several open Rustdoc tabs easier. Closes #84371.
2021-04-20Uses flex to fix formatting of h1 at any width.Tor Hovland-4/+9
2021-04-20Rollup merge of #84347 - Swatinem:simplify-document-fns, r=jyn514Dylan DPC-45/+11
rustdoc: Simplify some document functions * Remove `prefix` param of `document_short/full`, `render_markdown`, as its always an empty string. * Remove `Option` wrapping of `document_short` `parent`, as its always `Some`.
2021-04-20Rollup merge of #84340 - notriddle:patch-4, r=GuillaumeGomezDylan DPC-2/+2
rustdoc: Show nag box on IE11 Rustdoc doesn't work on IE11. It's been broken for months, it isn't supported by the [tiered browser support list], it's even more severely broken on other Rust websites, and IE11 doesn't support the `<details>` tag that we want to use. In the interest of honesty, let's give an actual error message for anyone on IE11. [tiered browser support list]: https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md
2021-04-20Auto merge of #83900 - torhovland:issue-83832, r=jyn514bors-9/+44
Add stability tags to ImportItem. Fixes #83832.
2021-04-19rustdoc: use details tag for trait implementorsJacob Hoffman-Andrews-24/+26
This switches from JS-generated toggles to using the HTML <details> tag for expanding and collapsing entries in the "Implementors" section.
2021-04-19rustdoc: Simplify some document functionsArpad Borsos-45/+11
* Remove `prefix` param of `document_short/full`, `render_markdown`, as its always an empty string. * Remove `Option` wrapping of `document_short` `parent`, as its always `Some`.
2021-04-19Use onEachLazy to iterate DOMTokenListMichael Howell-1/+1
2021-04-19rustdoc: Show nag box on IE10Michael Howell-1/+1
Rustdoc doesn't work on IE11. It's been broken for months, it isn't supported by the [tiered browser support list], it's even more severely broken on other Rust websites, and IE11 doesn't support the `<details>` tag that we want to use. In the interest of honesty, let's give an actual error message for anyone on IE11. [tiered browser support list]: https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md
2021-04-19Rollup merge of #84330 - GuillaumeGomez:remove-footer, r=jyn514Dylan DPC-1/+0
Remove unused footer section I realized yesterday while working on docs.rs that rustdoc was generating a "footer"section that it doesn't use. No need to keep it then. r? `@jyn514`
2021-04-19Remove collapse param from collapseNonInherent.Jacob Hoffman-Andrews-4/+4
2021-04-19No longer need to add attrs to ImportSource.Tor Hovland-10/+17
2021-04-19Remove unused footer sectionGuillaume Gomez-1/+0
2021-04-19rustdoc: Convert sub-variant toggle to HTMLArpad Borsos-6/+17
Instead of creating a JS toggle, this injects details/summary for sub-variants of enums. This also fixes the CSS so that the toggle button does not jump when expanding/collapsing.
2021-04-19Auto merge of #84283 - jsha:de-emphasize-attributes, r=GuillaumeGomezbors-4/+10
rustdoc: Reduce visual weight of attributes. Followup from #83337. As part of that PR, we stopped hiding attributes behind a toggle, because most things have just zero or one attributes. However, this made clear that the current rendering of attributes emphasizes them a lot, which distracts from function signatures. This PR changes their color of attributes to be the same as the toggles, and reduces their font weight. This also removes `#[lang]` from the list of ALLOWED_ATTRIBUTES. This attribute is an implementation detail rather than part of the public-facing documentation. ![image](https://user-images.githubusercontent.com/220205/115131061-cc407d80-9fa9-11eb-9a77-ad3f3217f391.png) Demo at https://hoffman-andrews.com/rust/de-emph-attr/std/string/struct.String.html#method.trim
2021-04-18rustdoc: make expand/collapse all ephemeralJacob Hoffman-Andrews-27/+17
The `[+]` in the upper right of a rustdoc page expands or collapses all toggles on the page. That state is stored across page loads, but is used inconsistently. This change explicitly stops storing or using the state.
2021-04-19Auto merge of #84288 - notriddle:short-links, r=jyn514bors-52/+44
rustdoc: get rid of CURRENT_DEPTH Fixes #82742
2021-04-18Put attrs in a Box for memory efficiency.Tor Hovland-4/+2
2021-04-18Now also displays portability tags.Tor Hovland-7/+14
2021-04-18Give import items their own CSS class.Tor Hovland-6/+11
2021-04-18Add stability tags to ImportItem.Tor Hovland-4/+22
2021-04-17rustdoc: get rid of CURRENT_DEPTHMichael Howell-52/+44
2021-04-18Fix the wrong return value type description of validateResulthi-rustin-1/+1
2021-04-17Reduce visual weight of attributes.Jacob Hoffman-Andrews-4/+10