about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2023-01-11Rollup merge of #106427 - mejrs:translation_errors, r=davidtwconils-1/+3
Improve fluent error messages These have been really frustrating me while migrating diagnostics.
2023-01-11Change `src/test` to `tests` in source files, fix tidy and testsAlbert Larsan-1/+1
2023-01-11Rollup merge of #106690 - GuillaumeGomez:item-declaration-scrolling, r=notriddleYuki Okushi-0/+4
Fix scrolling for item declaration block Fixes https://github.com/rust-lang/rust/issues/105580. The `contain: layout` was the issue here and the bug was actually on both mobile and desktop. r? `@notriddle`
2023-01-11Rollup merge of #106628 - GuillaumeGomez:rm-itemid-primitive, r=notriddleYuki Okushi-37/+61
Remove unneeded ItemId::Primitive variant As I mentioned [here](https://github.com/rust-lang/rust/pull/106412#issuecomment-1371405115), I wondered if `ItemId::Primitive` was actually used for anything. Apparently, it seems so because removing it led to no changes as far as I and tests could see. r? `@notriddle`
2023-01-10Remove unneeded ItemId::Primitive variantGuillaume Gomez-37/+61
2023-01-10Fix scrolling for item declaration blockGuillaume Gomez-0/+4
2023-01-09rustdoc: merge common CSS for `a`Michael Howell-4/+1
2023-01-08Make translate_message return result and add testsmejrs-1/+3
2023-01-07Rollup merge of #106556 - notriddle:notriddle/margin-left-content-mobile, ↵Matthias Krüger-4/+0
r=GuillaumeGomez rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }` This rule was added to override non-zero left margin on `.content`, which was removed in 135281ed1525db15edd8ebd092aa10aa40df2386 and the margin-left was put on the docblock.
2023-01-07Auto merge of #106558 - compiler-errors:rollup-lkii3j3, r=compiler-errorsbors-5/+1
Rollup of 4 pull requests Successful merges: - #106525 (Report WF error for chalk *and* new solver) - #106533 (Use smaller spans for missing lifetime/generic args) - #106543 (rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }`) - #106554 (Fix a typo in the explanation of E0588) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-06Rollup merge of #106543 - notriddle:notriddle/source-sidebar-width-zero, ↵Michael Goulet-5/+1
r=GuillaumeGomez rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }` This CSS was added in dc2c9723343c985740be09919236a6e96c4e4433, before 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c when the sidebars were merged. Now that they are merged, the source sidebar is being pushed off-screen anyway, so giving it zero width doesn't do much.
2023-01-06rustdoc: remove no-op mobile CSS `.content { margin-left: 0 }`Michael Howell-4/+0
This rule was added to override non-zero left margin on `.content`, which was removed in 135281ed1525db15edd8ebd092aa10aa40df2386 and the margin-left was put on the docblock.
2023-01-07Auto merge of #106538 - aDotInTheVoid:strip-use-doc-hidden, r=notriddlebors-0/+12
rustdoc: Strip imports of items which are `#[doc(hidden)]` Closes #106379
2023-01-06Rollup merge of #106466 - clubby789:relative-module-fix, r=notriddleMatthias Krüger-41/+103
Fix rustdoc source code rendering for `#[path = "../path/to/mod.rs"]` links Fixes #103517 While generating the location for modules source HTML to be saved at, a `..` path component appeared to be translated to `/up/`. Additionally, while generating the navigation sidebar, `..` path components were ignored. This means that (as in the issue above), a *real* directory structure of: ``` sys/ unix/ mod.rs <-- contains #![path = "../unix/mod.rs] cmath.rs ``` was rendered as: ``` sys/ unix/ mod.rs unix/ cmath.rs <-- links to sys/unix/unix/cmath.rs.html, 404 ``` While the *files* were stored as ``` sys/ unix/ mod.rs.html up/ unix/ cmath.rs.html ```
2023-01-06rustdoc: remove no-op CSS `.rustdoc.source .sidebar { width: 0 }`Michael Howell-5/+1
This CSS was added in dc2c9723343c985740be09919236a6e96c4e4433, before 6a5f8b1aef1417d7dc85b5d0a229d2db1930eb7c when the sidebars were merged. Now that they are merged, the source sidebar is being pushed off-screen anyway, so giving it zero width doesn't do much.
2023-01-06rustdoc: Strip imports of items which are `#[doc(hidden)]`Nixon Enraght-Moony-0/+12
Closes #106379
2023-01-06Correctly render sidebar for relative module pathsclubby789-41/+103
2023-01-06Rollup merge of #106502 - notriddle:notriddle/user-select, r=GuillaumeGomezDylan DPC-2/+0
rustdoc: remove legacy user-select CSS According to [caniuse], the only supported browser that requires the vendor prefix, as defined in [RFC 1985], is Safari. * The last version of Chrome that required a vendor prefix was version 53. The current version is 108. * Firefox 68 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The current version of Safari for Mac and iOS still requires a prefix. * The last version of Edge that required a vendor frefix was 18. The current version of Edge is 108. * UCAndroid support is unknown, but if it still requires a vendor prefix, it's more likely to be `-webkit-` than `-moz-` or `-ms-`, since they would want to emulate iOS for compatibility. [caniuse]: https://caniuse.com/?search=user-select [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-05rustdoc: remove legacy user-select CSSMichael Howell-2/+0
According to [caniuse], the only supported browser that requires the vendor prefix, as defined in [RFC 1985], is Safari. * The last version of Chrome that required a vendor prefix was version 53. The current version is 108. * Firefox 68 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The current version of Safari for Mac and iOS still requires a prefix. * The last version of Edge that required a vendor frefix was 18. The current version of Edge is 108. * UCAndroid support is unknown, but if it still requires a vendor prefix, it's more likely to be `-webkit-` than `-moz-` or `-ms-`, since they would want to emulate iOS for compatibility. [caniuse]: https://caniuse.com/?search=user-select [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-05Auto merge of #106487 - GuillaumeGomez:fix-kbd-var, r=notriddlebors-1/+1
Fix --kbd-color variable name in rustdoc.css Interestingly enough, it only impacted the dark theme. Before: ![Screenshot from 2023-01-05 11-03-17](https://user-images.githubusercontent.com/3050060/210754145-c3bb0f50-d35f-4543-bf73-010a4524a803.png) After: ![Screenshot from 2023-01-05 11-03-05](https://user-images.githubusercontent.com/3050060/210754190-85c2f146-a774-4463-9cd3-9495b7c91bd7.png) r? `@notriddle`
2023-01-05Fix --kbd-color variable name in rustdoc.cssGuillaume Gomez-1/+1
2023-01-04Rollup merge of #106462 - notriddle:notriddle/logo-container-sidebar, ↵Michael Goulet-18/+15
r=GuillaumeGomez rustdoc: remove unnecessary wrapper around sidebar and mobile logos This commit changes `.sidebar a:hover:not(.logo-container)` to add the `:not()` pseudo-class, retaining the old appearance of the logo when mousing over it. This didn't used to be necessary because the `a.sidebar-logo` was `display:inline`, and was what got the `background` changed on hover, while the `div.logo-container` inside it was `display:block`. This resulted in the hover rule not having any effect, because the logo-container box was not actually nested inside the sidebar-logo box: https://www.w3.org/TR/CSS2/visuren.html#anonymous-block-level > When an inline box contains an in-flow block-level box, the inline box (and its inline ancestors within the same line box) are broken around the block-level box (and any block-level siblings that are consecutive or separated only by collapsible whitespace and/or out-of-flow elements), splitting the inline box into two boxes (even if either side is empty), one on each side of the block-level box(es). The line boxes before the break and after the break are enclosed in anonymous block boxes, and the block-level box becomes a sibling of those anonymous boxes. When such an inline box is affected by relative positioning, any resulting translation also affects the block-level box contained in the inline box.
2023-01-04Rollup merge of #106403 - compiler-errors:rename-hir-methods, r=cjgillotMichael Goulet-1/+1
Rename `hir::Map::{get_,find_}parent_node` to `hir::Map::{,opt_}parent_id`, and add `hir::Map::{get,find}_parent` The `hir::Map::get_parent_node` function doesn't return a `Node`, and I think that's quite confusing. Let's rename it to something that sounds more like something that gets the parent hir id => `hir::Map::parent_id`. Same with `find_parent_node` => `opt_parent_id`. Also, combine `hir.get(hir.parent_id(hir_id))` and similar `hir.find(hir.parent_id(hir_id))` function into new functions that actually retrieve the parent node in one call. This last commit is the only one that might need to be looked at closely.
2023-01-04Rollup merge of #106437 - notriddle:notriddle/http-url, r=GuillaumeGomezMatthias Krüger-1/+1
rustdoc: fix buggy JS check for absolute URL The old code did the wrong thing when faced with a crate named "http".
2023-01-04Rollup merge of #106412 - ↵Matthias Krüger-8/+23
GuillaumeGomez:fix-links-to-primitive-rustdoc-json, r=aDotInTheVoid Fix link generation for local primitive types in rustdoc JSON output Fixes https://github.com/rust-lang/rust/issues/104064. As mentioned in the issue, I'm not super happy about this fix which is more a hack rather than a sound-proof solution. However I couldn't find a better way to fix it. r? `@aDotInTheVoid`
2023-01-04Rollup merge of #106391 - ardislu:fix-popover-child-link, r=GuillaumeGomezMatthias Krüger-3/+0
rustdoc: allow popover child links to work No need to prevent default click behavior on a `<div>`, it will also disable all child click behavior. Closes #106390
2023-01-04Remove unused match pattern for primitive typesGuillaume Gomez-1/+1
2023-01-04rustdoc: remove unnecessary wrapper around sidebar and mobile logosMichael Howell-18/+15
This commit changes `.sidebar a:hover:not(.logo-container)` to add the `:not()` pseudo-class, retaining the old appearance of the logo when mousing over it. This didn't used to be necessary because the `a.sidebar-logo` was `display:inline`, and was what got the `background` changed on hover, while the `div.logo-container` inside it was `display:block`. This resulted in the hover rule not having any effect, because the logo-container box was not actually nested inside the sidebar-logo box: https://www.w3.org/TR/CSS2/visuren.html#anonymous-block-level > When an inline box contains an in-flow block-level box, the inline box (and its inline ancestors within the same line box) are broken around the block-level box (and any block-level siblings that are consecutive or separated only by collapsible whitespace and/or out-of-flow elements), splitting the inline box into two boxes (even if either side is empty), one on each side of the block-level box(es). The line boxes before the break and after the break are enclosed in anonymous block boxes, and the block-level box becomes a sibling of those anonymous boxes. When such an inline box is affected by relative positioning, any resulting translation also affects the block-level box contained in the inline box.
2023-01-03rustdoc: fix buggy JS check for absolute URLMichael Howell-1/+1
The old code did the wrong thing when faced with a crate named "http".
2023-01-03Rollup merge of #106411 - notriddle:notriddle/font-feature-settings, ↵Michael Goulet-4/+0
r=GuillaumeGomez rustdoc: remove legacy font-feature-settings CSS According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985]. * The last version of Chrome that required a vendor prefix was version 47. The current version is 108. * Firefox 33 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The last version of Safari that required a vendor prefix was version 9.1. The current version is 16. * The last version of Safari/iOS that required a vendor prefix was version 9.3. The current version is 16. * Edge never required vendor prefixes. * UCAndroid never required vendor prefixes. [caniuse]: https://caniuse.com/?search=font-feature-settings [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-04rename find_parent_node to opt_parent_idMichael Goulet-1/+1
2023-01-03Fix link generation for local primitive types in rustdoc JSON outputGuillaume Gomez-7/+22
2023-01-03rustdoc: remove legacy font-feature-settings CSSMichael Howell-4/+0
According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985]. * The last version of Chrome that required a vendor prefix was version 47. The current version is 108. * Firefox 33 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The last version of Safari that required a vendor prefix was version 9.1. The current version is 16. * The last version of Safari/iOS that required a vendor prefix was version 9.3. The current version is 16. * Edge never required vendor prefixes. * UCAndroid never required vendor prefixes. [caniuse]: https://caniuse.com/?search=font-feature-settings [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-03Rollup merge of #106402 - Rageking8:fix_dupe_word_typos, r=NilstriebMatthias Krüger-1/+1
Fix dupe word typos r? `@Nilstrieb` Thanks!
2023-01-03Rollup merge of #106388 - notriddle:notriddle/box-sizing, r=camelidMatthias Krüger-2/+0
rustdoc: remove legacy box-sizing CSS According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985] * The last version of Chrome that required a vendor prefix was version 9. The current version is 108. * Firefox 28 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The last version of Safari that required a vendor prefix was version 5. The current version is 16. * The last version of Safari/iOS that required a vendor prefix was version 4. The current version is 16. * Edge never required vendor prefixes. * UCAndroid never required vendor prefixes. [caniuse]: https://caniuse.com/?search=box-sizing [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-03clean: Remove `ctor_kind` from `VariantStruct`.Nixon Enraght-Moony-13/+1
It's always `None`.
2023-01-03fix dupe word typosRageking8-1/+1
2023-01-02rustdoc: allow popover child links to workArdis Lu-3/+0
No need to prevent default click behavior on a <div>, it will also disable all child click behavior.
2023-01-02Rollup merge of #106366 - ↵Michael Goulet-1/+1
GuillaumeGomez:fix-rustdoc-ice-typedef-type-mismatch, r=notriddle Fix rustdoc ICE on bad typedef with mismatching types Fixes https://github.com/rust-lang/rust/issues/106226. Fixes #105742. Fixes #105737. Fixes #105334. Fixes #96287. In this case, it's ok to replace the panic with `rustc_error::raise` because the compiler provided us with a `Error`. r? `@notriddle`
2023-01-02Rollup merge of #106354 - aDotInTheVoid:rdj-always-discr, r=GuillaumeGomezMichael Goulet-62/+97
Rustdoc-Json: Report discriminant on all kinds of enum variant. Closes https://github.com/rust-lang/rust/issues/106299 Probably easier to review one commit at a time. r? `@GuillaumeGomez`
2023-01-02rustdoc: remove legacy box-sizing CSSMichael Howell-2/+0
According to [caniuse], these vendor prefixes aren't needed in any supported web browsers as defined in [RFC 1985] * The last version of Chrome that required a vendor prefix was version 9. The current version is 108. * Firefox 28 is the last version that required a vendor prefix. The [current Firefox ESR] is version 102. * The last version of Safari that required a vendor prefix was version 5. The current version is 16. * The last version of Safari/iOS that required a vendor prefix was version 4. The current version is 16. * Edge never required vendor prefixes. * UCAndroid never required vendor prefixes. [caniuse]: https://caniuse.com/?search=box-sizing [RFC 1985]: https://rust-lang.github.io/rfcs/1985-tiered-browser-support.html [current Firefox ESR]: https://wiki.mozilla.org/Releases
2023-01-02Fix rustdoc ICE on bad typedef with mismatching typesGuillaume Gomez-1/+1
2023-01-02Auto merge of #106301 - notriddle:notriddle/dir-entry, r=GuillaumeGomezbors-23/+2
rustdoc: use the regular arrow indicator for dir-entry CSS This mostly reverts 468acca108e65101b802821bded17149dc1d86c9, while still fixing the problem it fixed by using an internal list-style-position. It results in a slight change in the hover indicator, but nothing misleading. Preview: http://notriddle.com/notriddle-rustdoc-demos/dir-entry/src/std/lib.rs.html ## Before ![image](https://user-images.githubusercontent.com/1593513/210104247-642e6df0-07d3-452a-a2ab-4c700bc22e0e.png) ## After ![image](https://user-images.githubusercontent.com/1593513/210104271-a3832784-1e4d-4516-983e-6ecb9051857b.png)
2023-01-01Rustdoc-Json: Report discriminant on all kinds of enum variant.Nixon Enraght-Moony-5/+7
Closes #106299
2023-01-01clean: Always store enum disriminant.Nixon Enraght-Moony-59/+92
2022-12-31Rollup merge of #106297 - notriddle:notriddle/scrape-help, r=GuillaumeGomezMatthias Krüger-10/+6
rustdoc: merge scrape-help CSS
2022-12-30rustdoc: use the regular arrow indicator for dir-entry CSSMichael Howell-23/+2
This mostly reverts 468acca108e65101b802821bded17149dc1d86c9, while still fixing the problem it fixed by using an internal list-style-position. It results in a slight change in the hover indicator, but nothing misleading.
2022-12-30rustdoc: merge scrape-help CSSMichael Howell-10/+6
2022-12-30Rollup merge of #106273 - notriddle:notriddle/source-content-overflow, ↵Matthias Krüger-4/+0
r=GuillaumeGomez rustdoc: remove redundant CSS `.source .content { overflow: visible }` When added in 7669f04fb0ddc3d71a1fb44dc1c5c00a6564ae99 / #16066, the page itself was set to scroll. Now it's set so that the `example-wrap` is scrolling inside the page, so the overflow setting for the content is irrelevant.
2022-12-30Auto merge of #106262 - GuillaumeGomez:migrate-more-scraped-examples-css, ↵bors-24/+20
r=notriddle Migrate more scraped examples CSS rules to CSS variables It's based on https://github.com/rust-lang/rust/pull/106218 so it will need to wait for it to be merged first. r? `@notriddle`