about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2022-01-21rustdoc: Make some `pub` items crate-privateNoah Lev-1/+1
They don't need to be `pub`. Making them crate-private improves code clarity and `dead_code` linting.
2022-01-21Fix spacing for `·` between stability and sourceJacob Hoffman-Andrews-2/+1
2022-01-21Unify search input and buttons sizeGuillaume Gomez-106/+33
2022-01-21Rollup merge of #93139 - jsha:fix-wrapped-names, r=Nemo157Matthias Krüger-5/+25
rustdoc: fix overflow-wrap for table layouts For all table layouts, set overflow-wrap: break-word. Fixes #93135 Demo: https://rustdoc.crud.net/jsha/fix-wrapped-names/std/intrinsics/index.html#functions (Compare vs https://doc.rust-lang.org/nightly/std/intrinsics/index.html - you may have to make your browser narrower to see the effect) r? `@Nemo157`
2022-01-21rustdoc: remove dashed underline under main headingJacob Hoffman-Andrews-1/+0
2022-01-21Remove a span from hir::ExprKind::MethodCallCameron Steffen-2/+2
2022-01-21Auto merge of #93138 - matthiaskrgr:rollup-m8akifd, r=matthiaskrgrbors-1/+8
Rollup of 17 pull requests Successful merges: - #91032 (Introduce drop range tracking to generator interior analysis) - #92856 (Exclude "test" from doc_auto_cfg) - #92860 (Fix errors on blanket impls by ignoring the children of generated impls) - #93038 (Fix star handling in block doc comments) - #93061 (Only suggest adding `!` to expressions that can be macro invocation) - #93067 (rustdoc mobile: fix scroll offset when jumping to internal id) - #93086 (Add tests to ensure that `let_chains` works with `if_let_guard`) - #93087 (Fix src/test/run-make/raw-dylib-alt-calling-convention) - #93091 (⬆ chalk to 0.76.0) - #93094 (src/test/rustdoc-json: Check for `struct_field`s in `variant_tuple_struct.rs`) - #93098 (Show a more informative panic message when `DefPathHash` does not exist) - #93099 (rustdoc: auto create output directory when "--output-format json") - #93102 (Pretty printer algorithm revamp step 3) - #93104 (Support --bless for pp-exact pretty printer tests) - #93114 (update comment for `ensure_monomorphic_enough`) - #93128 (Add script to prevent point releases with same number as existing ones) - #93136 (Backport the 1.58.1 release notes to master) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-01-20rustdoc: fix overflow-wrap for table layoutsJacob Hoffman-Andrews-5/+25
For all table layouts, set overflow-wrap: break-word.
2022-01-20Rollup merge of #93067 - jsha:fix-scroll-padding-top, r=GuillaumeGomezMatthias Krüger-1/+8
rustdoc mobile: fix scroll offset when jumping to internal id Followup to #92692. The semantics of `scroll-margin-top` are a little surprising - the attribute needs to be applied to the element that gets scrolled into the viewport, not the scrolling element. This fixes an issue where clicking on a method (or other item) from the sidebar takes you to a scroll position where the topbar covers up the method name. I'm interested in ideas for how to test this with browser-ui-test, but I think it doesn't yet have what I need. What I need is an assert that `<element>.getBoundingClientRect().y` is > 45. Demo: https://rustdoc.crud.net/jsha/fix-scroll-padding-top/std/string/struct.String.html#method.extend_from_within r? `@GuillaumeGomez`
2022-01-20Rollup merge of #92861 - jsha:mobile-column-flex, r=GuillaumeGomezMatthias Krüger-9/+20
Rustdoc mobile: put out-of-band info on its own line Before this, the item name and the stability, source link, and "collapse all docs" would compete for room on a single line, resulting in awkward wrapping behavior on mobile. This gives a separate line for that out-of-band information. It also removes the "copy path" icon on mobile to make a little more room. Demo: https://rustdoc.crud.net/jsha/mobile-column-flex/std/string/struct.String.html r? `@GuillaumeGomez`
2022-01-20Rollup merge of #91694 - euclio:stability-improvements, r=GuillaumeGomezMatthias Krüger-36/+55
rustdoc: decouple stability and const-stability This PR tweaks the stability rendering code to consider stability and const-stability separately. This fixes two issues: - Stabilities that match the enclosing item are now always omitted, even if the item has const-stability as well (#90552) - Const-stable unstable functions will now have their (const-) stability rendered. Fixes #90552.
2022-01-19Rustdoc mobile: put out-of-band on its own lineJacob Hoffman-Andrews-9/+20
Before this, the item name and the stability, source link, and "collapse all docs" would compete for room on a single line, resulting in awkward wrapping behavior on mobile. This gives a separate line for that out-of-band information. It also removes the "copy path" icon on mobile to make a little more room. Also, switch to flex-wrap: wrap, so anytime there's not enough room for `source`, it gets bumped to the next line.
2022-01-19Fix scroll offset when jumping to internal idJacob Hoffman-Andrews-1/+8
2022-01-19Rollup merge of #93005 - GuillaumeGomez:templates-in-html, r=notriddleMatthias Krüger-0/+219
Move back templates into html folder Follow-up of https://github.com/rust-lang/rust/pull/92526. r? `@notriddle`
2022-01-19Move back templates into html folderGuillaume Gomez-0/+219
2022-01-18Remove horizontal lines at top of pageJacob Hoffman-Andrews-12/+0
They are not needed to separate the search bar and the title, which are visually distinct on their own.
2022-01-18Simplify and unify rustdoc sidebar stylesJacob Hoffman-Andrews-329/+161
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-3/+15
allow eq constraints on associated constants Updates #70256 (cc `@varkor,` `@Centril)`
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-15/+52
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-17Update term for use in more placeskadmin-3/+15
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-17Auto merge of #90986 - camsteffen:nested-filter, r=cjgillotbors-4/+5
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 #90187: Replace all def_id_no_primitives with def_idzredb-1/+1
2022-01-17fix #90187zredb-6/+17
2022-01-17fix #90187zredb-13/+10
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 #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-4/+5
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-11/+11
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-8/+6
librustdoc: Address some clippy lints
2022-01-14Auto merge of #91948 - nnethercote:rustdoc-more-Symbols, r=GuillaumeGomezbors-141/+234
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
2022-01-14rustdoc: avoid many `Symbol` to `String` conversions.Nicholas Nethercote-92/+176
Particularly when constructing file paths and fully qualified paths. This avoids a lot of allocations, speeding things up on almost all examples.
2022-01-14Link sidebar "location" heading to top of pageJacob Hoffman-Andrews-1/+1
This makes it easy, when you are scrolled far down in a page, to jump back to the top.
2022-01-14Rollup merge of #92854 - Urgau:better-rust-logo, r=GuillaumeGomezMatthias Krüger-3/+65
Use the updated Rust logo in rustdoc This pull-request use the updated Rust logo from https://github.com/rust-lang/rust-artwork/pull/9 and also change the logo format from PNG to SVG. | Before | After | | --- | --- | | ![Screenshot 2022-01-13 at 14-33-40 std - Rust](https://user-images.githubusercontent.com/3616612/149342697-7afe4c3e-2be5-444b-86f3-118712b4f7ae.png) | ![Screenshot 2022-01-13 at 14-33-15 std - Rust](https://user-images.githubusercontent.com/3616612/149342705-54ed27c6-0806-4c2d-baa1-4d65ed897e2b.png) | I also took the liberty to update the two PNG favicons with the SVG reducing their size by ~35% each. Fixes https://github.com/rust-lang/rust/issues/92831 r? ```@jsha```