about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2022-01-18Move render_macro_matcher to own moduleDavid Tolnay-189/+194
2022-01-18Render more readable macro matchers in rustdocDavid Tolnay-4/+139
2022-01-18Simplify and unify rustdoc sidebar stylesJacob Hoffman-Andrews-330/+174
This switches to just use size, weight, and spacing to distinguish headings in the sidebar. We no longer use boxes, horizontal bars, or centering to distinguish headings. This makes it much easier to understand the hierarchy of headings, and reduces visual noise. I also refactored how the mobile topbar works. Previously, we tried to shift around elements from the sidebar to make the topbar. Now, the topbar gets its own elements, which can be styled on their own. This makes styling and reasoning about those elements simpler. Because the heading font sizes are bigger, increase the sidebar width slightly. As a very minor change, removed version from the "All types" page. It's now only on the crate page.
2022-01-18Auto merge of #87648 - JulianKnodt:const_eq_constrain, r=oli-obkbors-31/+103
allow eq constraints on associated constants Updates #70256 (cc `@varkor,` `@Centril)`
2022-01-18Rollup merge of #92947 - vacuus:rustdoc-core-visit-path, r=camelidMatthias Krüger-3/+3
rustdoc: Use `intersperse` in a `visit_path` function (~~Is there a better way to word the title?~~ Eh, this works, I guess.) I'm surprised that the compiler didn't complain when I left out the `.to_string()`, but hey, if it works then it works.
2022-01-18Rollup merge of #92830 - jsha:style-cleanups, r=GuillaumeGomezMatthias Krüger-41/+21
Rustdoc style cleanups - Make "since" version numbers grey again (regressed in #92602). - Remove unneeded selectors for when crate filter dropdown is a sibling of search-input. - Crate filter dropdown doesn't need to be 100% width on mobile. - Only build crate filter dropdown when there is more than one crate. - Remove unused addCrateDropdown Demo: https://rustdoc.crud.net/jsha/style-cleanups/std/string/struct.String.html r? `@GuillaumeGomez`
2022-01-18Rollup merge of #92803 - jsha:hide-sidebar, r=GuillaumeGomezMatthias Krüger-0/+4
Hide mobile sidebar on some clicks When the user clicks outside the sidebar, the sidebar should close. Also, when the user clicks an internal link in the sidebar, it should close. Fixes #92682 Demo: https://rustdoc.crud.net/jsha/hide-sidebar/std/string/struct.String.html
2022-01-18Rollup merge of #92629 - jsha:theme-picker-local-only-2, r=GuillaumeGomezMatthias Krüger-16/+53
Pick themes on settings page, not every page This hides the paintbrush icon on most pages by default, in preference for the settings on the settings page. When loading from a local file, and not in mobile view, continue to show the theme picker. That's because some browsers limit access to localStorage from file:/// URLs, so choosing a theme from settings.html doesn't take effect. Fixes #84539 Part of #59840 r? `@GuillaumeGomez` Demo: https://rustdoc.crud.net/jsha/theme-picker-local-only-2/std/io/trait.Read.html
2022-01-17Hide mobile sidebar on some clicksJacob Hoffman-Andrews-0/+4
When the user clicks outside the sidebar, the sidebar should close. Also, when the user clicks an internal link in the sidebar, it should close.
2022-01-17Add term to ExistentialProjectionkadmin-1/+1
Also prevent ICE when adding a const in associated const equality.
2022-01-17Update w/ commentskadmin-4/+1
Removes uses of ty() where a method is implemented on TypeFoldable, and also directly formats a Term.
2022-01-17Update term for use in more placeskadmin-34/+106
Replace use of `ty()` on term and use it in more places. This will allow more flexibility in the future, but slightly worried it allows items which are consts which only accept types.
2022-01-17Rustdoc style cleanupsJacob Hoffman-Andrews-46/+21
- Make "since" version numbers grey again (regressed in #92602). - Remove unneeded selectors for when crate filter dropdown is a sibling of search-input. - Crate filter dropdown doesn't need to be 100% width on mobile. - Only build crate filter dropdown when there is more than one crate. - Remove unused addCrateDropdown.
2022-01-17Rollup merge of #92936 - vacuus:html-markdown-parse, r=GuillaumeGomezMatthias Krüger-3/+1
rustdoc: Remove `collect` in `html::markdown::parse`
2022-01-17Rollup merge of #92801 - jsha:overflow-wrap, r=GuillaumeGomezMatthias Krüger-0/+16
Enable wrapping words by default Faced with a very long word, browsers will let it overflow its box horizontally rather than break it in the middle. We essentially never want that behavior. We would rather break the word and keep it inside its horizontal limits. So we apply a default overflow-wrap: break-word/anywhere to the document as a while. In some contexts we would rather add a horizontal scrollbar (code blocks), or elide the excess text with an ellipsis (sidebar). Those still work as expected. Fixes #92771 [Some related discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/wrap.20.2F.20overflow.20.2F.20scroll) and a related issue: #92421. Demo: https://rustdoc.crud.net/jsha/overflow-wrap/std/iter/trait.Iterator.html#method.try_find r? ``@GuillaumeGomez``
2022-01-17Use Term in ProjectionPredicatekadmin-8/+10
ProjectionPredicate should be able to handle both associated types and consts so this adds the first step of that. It mainly just pipes types all the way down, not entirely sure how to handle consts, but hopefully that'll come with time.
2022-01-17add eq constraints on associated constantskadmin-1/+2
2022-01-17Auto merge of #90986 - camsteffen:nested-filter, r=cjgillotbors-15/+18
Replace `NestedVisitorMap` with generic `NestedFilter` This is an attempt to make the `intravisit::Visitor` API simpler and "more const" with regard to nested visiting. With this change, `intravisit::Visitor` does not visit nested things by default, unless you specify `type NestedFilter = nested_filter::OnlyBodies` (or `All`). `nested_visit_map` returns `Self::Map` instead of `NestedVisitorMap<Self::Map>`. It panics by default (unreachable if `type NestedFilter` is omitted). One somewhat trixty thing here is that `nested_filter::{OnlyBodies, All}` live in `rustc_middle` so that they may have `type Map = map::Map` and so that `impl Visitor`s never need to specify `type Map` - it has a default of `Self::NestedFilter::Map`.
2022-01-17Correctly handle pure genericsGuillaume Gomez-4/+6
2022-01-17fix #90187zredb-15/+3
remove the definition of def_id_no_primitives and change; a missing use was modified; narrow the Cache accessibility of BadImplStripper;
2022-01-17fix #90187: Replace all def_id_no_primitives with def_idzredb-2/+2
2022-01-17fix #90187zredb-15/+30
2022-01-17fix #90187zredb-17/+15
2022-01-17Rollup merge of #92937 - GuillaumeGomez:dot-separator, r=jshaMatthias Krüger-3/+7
rustdoc: Add missing dot separator Fixes #92901. ![Screenshot from 2022-01-15 17-47-18](https://user-images.githubusercontent.com/3050060/149631249-e2c0c3a4-9ed8-48e2-92cc-79a5bb347b35.png) r? ``@jsha``
2022-01-17Rollup merge of #92819 - euclio:atty, r=CraftSpiderMatthias Krüger-41/+16
rustdoc: remove hand-rolled isatty This PR replaces bindings to the platform-specific isatty APIs with the `isatty` crate, as done elsewhere in the repository.
2022-01-17Rollup merge of #92799 - rust-lang:followup-from-92533, r=Aaron1011Matthias Krüger-7/+3
Remove some unnecessary uses of `FieldDef::ident` Followup from #92533. cc ``@Aaron1011`` ``@petrochenkov``
2022-01-17Rollup merge of #92795 - jsha:link-to-top, r=GuillaumeGomezMatthias Krüger-1/+1
Link sidebar "location" heading to top of page This makes it easy, when you are scrolled far down in a page, to jump back to the top. Demo: https://rustdoc.crud.net/jsha/link-to-top/std/string/struct.String.html r? ``@GuillaumeGomez``
2022-01-16Replace NestedVisitorMap with NestedFilterCameron Steffen-15/+18
2022-01-16Rollup merge of #92792 - mdibaiee:92662/fix-intra-doc-generics, r=camelidMatthias Krüger-1/+12
rustdoc: fix intra-link for generic trait impls fixes #92662 r? `````@camelid`````
2022-01-16Rollup merge of #92635 - camelid:yet-more-cleanup, r=ManishearthMatthias Krüger-157/+159
rustdoc: Yet more intra-doc links cleanup r? `@Manishearth`
2022-01-16Auto merge of #92805 - BoxyUwU:revert-lazy-anon-const-substs, r=lcnrbors-1/+1
partially revertish `lazily "compute" anon const default substs` reverts #87280 except for some of the changes around `ty::Unevaluated` having a visitor and a generic for promoted why revert: <https://github.com/rust-lang/rust/pull/92805#issuecomment-1010736049> r? `@lcnr`
2022-01-16Auto merge of #92740 - cuviper:update-rayons, r=Mark-Simulacrumbors-1/+1
Update rayon and rustc-rayon This updates rayon for various tools and rustc-rayon for the compiler's parallel mode. - rayon v1.3.1 -> v1.5.1 - rayon-core v1.7.1 -> v1.9.1 - rustc-rayon v0.3.1 -> v0.3.2 - rustc-rayon-core v0.3.1 -> v0.3.2 ... and indirectly, this updates all of crossbeam-* to their latest versions. Fixes #92677 by removing crossbeam-queue, but there's still a lingering question about how tidy discovers "runtime" dependencies. None of this is truly in the standard library's dependency tree at all.
2022-01-15Remove `collect`Roc Yu-3/+3
2022-01-15Return a LocalDefId in get_parent_item.Camille GILLOT-2/+4
2022-01-15Rustdoc: remove ListAttributesIter and use impl Iterator insteadJakub Beránek-46/+19
2022-01-15Fix broken linkNoah Lev-1/+1
2022-01-15Fix missing dot separatorGuillaume Gomez-3/+7
2022-01-15Remove `collect`Roc Yu-3/+1
2022-01-14Add support for "always theme" in settingJacob Hoffman-Andrews-4/+41
2022-01-14Pick themes on settings page, not every pageJacob Hoffman-Andrews-12/+12
This hides the paintbrush icon on most pages by default, in preference for the settings on the settings page. When loading from a local file, and not in mobile view, continue to show the theme picker. That's because some browsers limit access to localStorage from file:/// URLs, so choosing a theme from settings.html doesn't take effect.
2022-01-14Enable wrapping words by defaultJacob Hoffman-Andrews-0/+16
Faced with a very long word, browsers will let it overflow its box horizontally rather than break it in the middle. We essentially never want that behavior. We would rather break the word and keep it inside its horizontal limits. So we apply a default overflow-wrap: break-word/anywhere to the document as a while. In some contexts we would rather add a horizontal scrollbar (code blocks), or elide the excess text with an ellipsis (sidebar). Those still work as expected.
2022-01-15Rollup merge of #92868 - pierwill:librustdoc-clippy, r=camelidMatthias Krüger-13/+11
librustdoc: Address some clippy lints
2022-01-15initial revertEllen-1/+1
2022-01-14Auto merge of #91948 - nnethercote:rustdoc-more-Symbols, r=GuillaumeGomezbors-169/+255
rustdoc: avoid many `Symbol` to `String` conversions. Particularly when constructing file paths and fully qualified paths. This avoids a lot of allocations, speeding things up on almost all examples. r? `@GuillaumeGomez`
2022-01-14Document and test `UrlPartsBuilder::push_fmt`Noah Lev-0/+23
2022-01-14Make `AVG_PART_LENGTH` a power of 2Noah Lev-3/+10
I seem to recall that in general, it's best to request an allocation with a size that's a power of 2. The low estimate of 5 was probably a little too low as well.
2022-01-14Estimate path length instead of hardcoding 64 bytesNoah Lev-2/+10
2022-01-14Use UrlPartsBuilder and remove `join_with_slash`Noah Lev-36/+16
2022-01-14rustdoc: remove some unnecessary sigils.Nicholas Nethercote-1/+1
2022-01-14rustdoc: remove many unnecessary `.as_ref()` calls.Nicholas Nethercote-38/+29