summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2021-05-22Call `initSidebarItems` in root module of crateJustus K-3/+14
2021-05-05Revert PR 83866Pietro Albini-35/+8
That PR caused multiple test failures when Rust's channel is changed from nightly to anything else. The commit will have to be landed again after the test suite is fixed.
2021-05-04manually crafted revert of PR #80653, to address issue #82465.Felix S. Klock II-93/+44
(update: placated tidy)
2021-04-29Rollup merge of #84690 - ↵Jack Huey-1/+0
GuillaumeGomez:unneeded-bottom-margin-search-results, r=Nemo157 Remove unneeded bottom margin on search results As you can see, there is still more than enough space at the bottom: ![Screenshot from 2021-04-29 11-26-57](https://user-images.githubusercontent.com/3050060/116530090-ea797800-a8dd-11eb-8eef-2288cf68e0d2.png) r? ``````@Nemo157``````
2021-04-29Rollup merge of #84688 - ↵Jack Huey-7/+0
GuillaumeGomez:remove-unnecessary-css-for-search-results, r=Nemo157 Remove unnecessary CSS rules for search results Discovered that this was useless when working on https://github.com/rust-lang/docs.rs/issues/1382. r? ````````@Nemo157````````
2021-04-29Rollup merge of #84451 - torhovland:flex, r=jshaJack Huey-14/+8
Use flex more consistently Builds on #84376, related to #84354. - Fully replaces `float: right` with `flex` on `.content .out-of-band`. - Uses `flex` more consistently with existing usage (on `h3`, `h4`, etc.). Tested on various widths to make sure the pages behave as before.
2021-04-29Remove unneeded bottom margin on search resultsGuillaume Gomez-1/+0
2021-04-29Remove unnecessary CSS rules for search resultsGuillaume Gomez-7/+0
2021-04-28Rollup merge of #84636 - notriddle:data-aliases, r=jyn514,GuillaumeGomezJack Huey-2/+2
rustdoc: change aliases attribute to data-aliases The "aliases" attribute is not listed [on MDN], so it sounds like it's rustdoc-specific. We don't want to conflict with any attributes that are added to the spec in the future. [on MDN]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements
2021-04-28Rollup merge of #84484 - jyn514:check-tools, r=Mark-SimulacrumJack Huey-1/+1
Don't rebuild rustdoc and clippy after checking bootstrap This works by unconditionally passing -Z unstable-options to the compiler. This has no affect in practice since bootstrap doesn't use `deny(rustc::internal)`. Fixes https://github.com/rust-lang/rust/issues/82461. r? ```@Mark-Simulacrum```
2021-04-28rustdoc: change aliases attribute to data-aliasesMichael Howell-2/+2
The "aliases" attribute is not listed [on MDN], so it sounds like it's rustdoc-specific. We don't want to conflict with any attributes that are added to the spec in the future. [on MDN]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/Heading_Elements
2021-04-28Rollup merge of #84616 - GuillaumeGomez:fix-empty-dom-toggle, r=jshaYuki Okushi-97/+112
Fix empty dom toggle Currently, the empty impl blocks have toggles: ![Screenshot from 2021-04-27 15-15-03](https://user-images.githubusercontent.com/3050060/116249703-5ee0d980-a76d-11eb-9e15-738c06e4fb1b.png) So when you expand it, nothing happens: ![Screenshot from 2021-04-27 15-15-07](https://user-images.githubusercontent.com/3050060/116249746-686a4180-a76d-11eb-8dc1-221ca0ac57c5.png) So now, in case the impl block is empty, we simply don't generate the details/summary wrapping (which also makes DOM lighter, yeay!): ![Screenshot from 2021-04-27 15-14-15](https://user-images.githubusercontent.com/3050060/116249825-7a4be480-a76d-11eb-9637-b26151311ebd.png) r? `@jsha`
2021-04-27Auto merge of #84494 - tdelabro:84304-bis, r=jyn514bors-128/+158
84304 - rustdoc: shrink Item::Attributes Helps with https://github.com/rust-lang/rust/issues/84304
2021-04-27Switch `rustc::internal` from deny to warnJoshua Nelson-1/+1
These should still obey deny-warnings.
2021-04-27Don't put empty implementations into details/summary blocksGuillaume Gomez-97/+112
2021-04-27cfg taken out of Attributes, put in ItemTimothée Delabrouille-85/+104
check item.is_fake() instead of self_id.is_some() Remove empty branching in Attributes::from_ast diverse small refacto after Josha review cfg computation moved in merge_attrs refacto use from_ast twice for coherence take cfg out of Attributes and move it to Item
2021-04-27Removed usage of Attributes in FnDecl and ExternalCrate. Relocate part of ↵Timothée Delabrouille-53/+64
the fields in Attributes, as functions in AttributesExt. refacto use from_def_id_and_attrs_and_parts instead of an old trick most of josha suggestions + check if def_id is not fake before using it in a query Removed usage of Attributes in FnDecl and ExternalCrate. Relocate part of the Attributes fields as functions in AttributesExt.
2021-04-27Auto merge of #84552 - GuillaumeGomez:open-impl-blocks-by-default, r=jshabors-4/+6
Open impl blocks by default Fixes #84558. Part of #84422. As you can see on https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html, impl blocks are currently not open by default whereas they should. I also realized that a test was outdated so I removed it and opened #84550 because it seems like the rustdoc-gui test suite isn't run on CI... cc `@jyn514` r? `@jsha`
2021-04-26Rollup merge of #84574 - hi-rustin:rustin-patch-typo, r=jyn514Mara Bos-2/+2
rustdoc: Fix typos in maybe_inline_local fn Introduced by https://github.com/rust-lang/rust/pull/79061. r? `@jyn514`
2021-04-26Add open attribute on details which are supposed to be open by default ↵Guillaume Gomez-4/+2
instead of opening them with JS
2021-04-26rustdoc: Fix typo for maybe_inline_local fnhi-rustin-2/+2
2021-04-25Auto merge of #84564 - Dylan-DPC:rollup-wxa2yr0, r=Dylan-DPCbors-4/+3
Rollup of 8 pull requests Successful merges: - #84235 (refactor StyledBuffer) - #84450 (Give a better error when `std` or `core` are missing) - #84486 (Handle pretty printing of `else if let` clauses without ICEing) - #84499 (Tweak trait not `use`d suggestion) - #84516 (Add suggestion to "use break" when attempting to implicit-break a loop) - #84520 (Improve diagnostics for function passed when a type was expected.) - #84541 (Inline most raw socket, fd and handle conversions) - #84547 (Get rid of is_min_const_fn) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-04-25Auto merge of #84325 - jsha:ephemeral-collapse, r=GuillaumeGomezbors-28/+18
rustdoc: make expand/collapse all ephemeral 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. This also moves the code for toggling display of trait implementations so that it's near the other toggling code. Fixes #84318
2021-04-25Fix expansion for item pointed to by the URL hashGuillaume Gomez-0/+2
2021-04-25Open all impl blocks by defaultGuillaume Gomez-2/+4
2021-04-25get rid of min_const_fn references in library/ and rustdocRalf Jung-4/+3
2021-04-25Auto merge of #80339 - jyn514:no-span, r=GuillaumeGomezbors-55/+80
Calculate `span` info on-demand - Add helper `attr_span` for common reused function - Stop storing `Span`s on `Item` directly; calculate them on demand instead - Special case modules, which have different spans depending on whether you use inner or outer attributes - Special case impls with fake IDs, which can have either dummy spans (for auto traits) or the DefId of the impl block (for blanket impls) - Use a fake ID for primitives instead of the ID of the crate; this lets `source()` know that it should use a dummy span instead of the span of the crate. This shrinks `Item` from 48 to 40 bytes. Helps with https://github.com/rust-lang/rust/issues/76382.
2021-04-24Finally (finally) ((finally!!!!)) fix spans for the standard libraryJoshua Nelson-1/+5
2021-04-24Get rid of `item.span`Joshua Nelson-36/+44
- Remove `span` field, adding `Item::span()` instead - Special-case `Impl` and `Module` items - Use dummy spans for primitive items
2021-04-24Do the hard part firstJoshua Nelson-20/+33
The only bit failing was the module, so change that before removing the `span` field.
2021-04-24Add attr_span helper functionJoshua Nelson-17/+17
2021-04-24Auto merge of #84511 - davidhewitt:revert-84445, r=GuillaumeGomezbors-13/+6
Revert "rustdoc: Hide `#text` in doc-tests" See discussion in #84502 - I'm worried that #84445 may cause a lot of breakages if this were to hit stable, so I think it's safer to revert and work on the known correct fix #84478.
2021-04-25Rollup merge of #84518 - GuillaumeGomez:cleanup-up-dom-string, r=jshaYuki Okushi-4/+9
Clean up DOM strings Follow-up of #84320. r? ``@jsha``
2021-04-25Rollup merge of #84464 - jyn514:type-kind, r=CraftSpiderYuki Okushi-134/+93
rustdoc: Get rid of `clean::TypeKind` It does exactly the same thing as ItemType.
2021-04-25Rollup merge of #84460 - jyn514:doctree-is-crate, r=camelidYuki Okushi-42/+26
rustdoc: Remove unnecessary `is_crate` field from doctree::Module and clean::Module It can be calculated on-demand even without a TyCtxt. This also changed `json::conversions::from_item_kind` to take a whole item, which avoids having to add more and more parameters. Helps with https://github.com/rust-lang/rust/issues/76382. r? ```@camelid```
2021-04-24rustdoc: Turn `JsonRenderer::mod_item_in` into `unreachable!()`Joshua Nelson-15/+2
The JSON renderer no longer gets called on modules.
2021-04-24Clean up DOM stringsGuillaume Gomez-4/+9
2021-04-24Revert "rustdoc: Hide `#text` in doc-tests"David Hewitt-13/+6
This reverts commit af6c3201fc3d5ec2559836454ea4f43eec583fa2.
2021-04-24Rollup merge of #84492 - jyn514:span, r=camelidYuki Okushi-3/+4
rustdoc: Remove unnecessary dummy span Follow-up to https://github.com/rust-lang/rust/pull/84460#discussion_r619447655. r? `@camelid`
2021-04-24Rollup merge of #84458 - jyn514:cleanup-after-krate, r=GuillaumeGomezYuki Okushi-79/+39
Remove unnecessary fields and parameters in rustdoc r? `@GuillaumeGomez`
2021-04-24Rollup merge of #84320 - jsha:details-implementors, ↵Yuki Okushi-24/+26
r=Manishearth,Nemo157,GuillaumeGomez Use details tag for trait implementors. Part of #83332 and following on from #83337 and #83355. This removes one category of JS-generated toggles (implementors), and replaces them with a `<details>` tag. This simplifies the JS, and fixes some bugs where things that were supposed to be hidden by the toggle were not hidden. Compare https://hoffman-andrews.com/rust/details-implementors/std/io/trait.Read.html#impl-Read vs https://doc.rust-lang.org/nightly/std/io/trait.Read.html#implementors. This introduces a `left: -23px` to put the toggle in the correct place, matching the current style for `.collapse-toggle`. It's worth noting this introduces a slight behavior change: since the entire line is now a `<summary>`, any part of the line is clickable. So for instance, in `impl Read for File`, clicking `impl` or `for` will collapse / expand the docs. Clicking `Read` or `File` still links to the appropriate documentation as before.
2021-04-23Fix macro bug in `impl From<DefKind> for ItemType`Joshua Nelson-1/+5
This was missed a while ago when support for proc-macro attributes was first added.
2021-04-23Don't repeat `hir::def::DefKind` so muchJoshua Nelson-33/+33
2021-04-23Remove unused `impl Clean<ItemType> for DefKind`Joshua Nelson-6/+0
2021-04-23Remove `TypeKind`Joshua Nelson-53/+0
2021-04-23Use ItemType in cacheJoshua Nelson-32/+11
2021-04-23Take ItemType instead of TypeKind in record_extern_fqnJoshua Nelson-49/+84
2021-04-23rustdoc: Remove unnecessary dummy spanJoshua Nelson-3/+4
2021-04-23rustdoc: Remove unnecessary `is_crate` field from doctree::Module and ↵Joshua Nelson-42/+26
clean::Module It can be calculated on-demand even without a TyCtxt. This also changed `from_item_kind` to take a whole item, which avoids having to add more and more parameters.
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````