about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2022-10-30Rollup merge of #103722 - GuillaumeGomez:cleanup-code-example-css, r=notriddleMatthias Krüger-28/+24
Fix z-indexes of code example feature and cleanup its CSS When reviewing https://github.com/rust-lang/rust/pull/103650, I realized that the `z-index`es of this feature were completely broken: ![Screenshot from 2022-10-28 10-55-27](https://user-images.githubusercontent.com/3050060/198826360-0c5cbe5a-ea8e-452a-9504-38d3da3615e6.png) This PR fixes it by reducing the value of value under the one used for `.popover` (it could be completely removed but then it wouldn't be displayed as nicely). There was also a lot of duplicated CSS so I merged the rules. r? `@notriddle`
2022-10-29Move string literal into format stringJacob Hoffman-Andrews-1/+1
Co-authored-by: Michael Howell <michael@notriddle.com>
2022-10-29Generate static file hashes onceJacob Hoffman-Andrews-15/+23
2022-10-29Make --static-root-path point to static.filesJacob Hoffman-Andrews-10/+16
2022-10-29rustdoc: add hash to filename of toolchain filesJacob Hoffman-Andrews-490/+245
All static files used by rustdoc are now stored in static.files/ and include a hash of their contents. They no longer include the contents of the --resource-suffix flag. This clarifies caching semantics. Anything in static.files can use Cache-Control: immutable because any updates will show up as a new URL. Invocation-specific files like crates-NN.js, search-index-NN.js, and sidebar-items-NN.js still get the resource suffix. The --disable-minification flag is removed because it would vary the output of static files based on invocation flags. Instead, for rustdoc development purposes it's preferable to symlink static files to a non-minified copy for quick iteration.
2022-10-29rustdoc: Split effective visibilities from rustc from similar data built by ↵Vadim Petrochenkov-41/+68
rustdoc for external def-ids
2022-10-29rustdoc: Simplify modifications of effective visibility tableVadim Petrochenkov-79/+32
2022-10-29rustdoc: remove unnecessary `.search-results { padding-bottom }`Michael Howell-1/+0
There's nothing underneath it anyway. The conversation on b615c0c85469c94041a5e68b9d8b68dcf799f9f1 never really spelled out why it was added.
2022-10-29rustdoc: use CSS margin/padding shorthand when all are being setMichael Howell-10/+3
2022-10-29Rollup merge of #103653 - GuillaumeGomez:missing-impl-private-json, r=notriddleGuillaume Gomez-5/+25
Add missing impl blocks for item reexported from private mod in JSON output Fixes #102583. Since we don't inline for the JSON output, the impl blocks from private modules are not present when we generate the output. To go around this limitation, in case the impl block doesn't have `#[doc(hidden)]` and is implementing a public item, we don't strip it. cc `@fmease` `@aDotInTheVoid` r? `@notriddle`
2022-10-29Rollup merge of #103625 - WaffleLapkin:no_tyctxt_dogs_allowed, r=compiler-errorsGuillaume Gomez-1/+1
Accept `TyCtxt` instead of `TyCtxtAt` in `Ty::is_*` functions Functions in answer: - `Ty::is_freeze` - `Ty::is_sized` - `Ty::is_unpin` - `Ty::is_copy_modulo_regions` This allows to remove a lot of useless `.at(DUMMY_SP)`, making the code a bit nicer :3 r? `@compiler-errors`
2022-10-29Rollup merge of #103618 - nnethercote:rename-OwnerId-fields, r=compiler-errorsGuillaume Gomez-23/+23
Rename some `OwnerId` fields. `@spastorino` noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone. r? `@compiler-errors`
2022-10-29Fix z-indexes of code example feature and cleanup its CSSGuillaume Gomez-28/+24
2022-10-29Add regression test for missing item from private mod in JSON outputGuillaume Gomez-1/+1
2022-10-29Add missing impl blocks for item reexported from private mod in JSON outputGuillaume Gomez-5/+25
2022-10-29Rename some `OwnerId` fields.Nicholas Nethercote-23/+23
spastorino noticed some silly expressions like `item_id.def_id.def_id`. This commit renames several `def_id: OwnerId` fields as `owner_id`, so those expressions become `item_id.owner_id.def_id`. `item_id.owner_id.local_def_id` would be even clearer, but the use of `def_id` for values of type `LocalDefId` is *very* widespread, so I left that alone.
2022-10-29Auto merge of #103714 - matthiaskrgr:rollup-kajt3i8, r=matthiaskrgrbors-31/+24
Rollup of 7 pull requests Successful merges: - #102961 (Make `CStr::from_ptr` `const`.) - #103342 (Add test for issue 98634) - #103383 (Note scope of TAIT more accurately) - #103656 (Specialize ToString for Symbol) - #103663 (rustdoc: remove redundant CSS/DOM `div.search-container`) - #103664 (rustdoc-json-types: Improve ItemSummary::path docs) - #103704 (Add a test for TAIT used with impl/dyn Trait inside RPIT) Failed merges: - #103618 (Rename some `OwnerId` fields.) r? `@ghost` `@rustbot` modify labels: rollup
2022-10-29Rollup merge of #103663 - notriddle:notriddle/search-container, r=GuillaumeGomezMatthias Krüger-31/+24
rustdoc: remove redundant CSS/DOM `div.search-container` Preview: https://notriddle.com/notriddle-rustdoc-demos/search-container/test_dingus/fn.test.html This wrapper DIV was originally added in 89e1fb322321c05497caa01372ceb7d5b57fa680, when it allowed the search bar's size to be calculated without using `calc()`. This `width` hack can be removed using flexbox.
2022-10-29Auto merge of #102698 - michaelwoerister:unord-collections, r=lncrbors-2/+2
Introduce UnordMap, UnordSet, and UnordBag (MCP 533) This is the start of implementing [MCP 533](https://github.com/rust-lang/compiler-team/issues/533). I followed `@eddyb's` suggestion of naming the collection types `Unord(Map/Set/Bag)` which is a bit easier to type than `Unordered(Map/Set/Bag)` r? `@eddyb`
2022-10-29Auto merge of #102233 - petrochenkov:effvis, r=jackh726bors-41/+47
privacy: Rename "accessibility levels" to "effective visibilities" And a couple of other naming and comment tweaks. Related to https://github.com/rust-lang/rust/issues/48054 For `enum Level` I initially used naming `enum EffectiveVisibilityLevel`, but it was too long and inconvenient because it's used pretty often. So I shortened it to just `Level`, if it needs to be used from some context where this name would be ambiguous, then it can be imported with renaming like `use rustc_middle::privacy::Level as EffVisLevel` or something.
2022-10-28Auto merge of #103671 - matthiaskrgr:rollup-iuugpep, r=matthiaskrgrbors-8/+35
Rollup of 5 pull requests Successful merges: - #102642 (Add tests for static async functions in traits) - #103283 (Add suggestions for unsafe impl error codes) - #103523 (Fix unwanted merge of inline doc comments for impl blocks) - #103550 (diagnostics: do not suggest static candidates as traits to import) - #103641 (Don't carry MIR location in `ConstraintCategory::CallArgument`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-10-28Rollup merge of #103643 - notriddle:notriddle/summary-focus-visible, ↵Matthias Krüger-4/+2
r=GuillaumeGomez rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tags We really shouldn't be overriding this kind of stuff unless the browser default is really broken (like outlining the thing that isn't clickable). This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.
2022-10-28Rollup merge of #103585 - GuillaumeGomez:source-line-css, r=notriddleMatthias Krüger-31/+17
Migrate source line numbers CSS to CSS variables Part of https://github.com/rust-lang/rust/pull/98460. No UI changes. r? ``@notriddle``
2022-10-28Rollup merge of #103523 - GuillaumeGomez:inline-doc-comment-impl-block, ↵Matthias Krüger-8/+35
r=notriddle Fix unwanted merge of inline doc comments for impl blocks Fixes https://github.com/rust-lang/rust/issues/102909. We need this merge mechanism for inlined items but it's completely unwanted for impl blocks (at least the doc comments are, not the other attributes) since we want to keep what `cfg()` is put on the `pub use` or other attributes. r? ``@notriddle``
2022-10-27rustdoc: remove redundant `div.search-container`Michael Howell-31/+24
This wrapper DIV was originally added in 89e1fb322321c05497caa01372ceb7d5b57fa680, when it allowed the search bar's size to be calculated without using `calc()`. This `width` hack can be removed using flexbox.
2022-10-27rustdoc: stop hiding focus outlines on non-rustdoc-toggle details tagsMichael Howell-4/+2
We really shouldn't be overriding this kind of stuff unless the browser default is really broken (like outlining the thing that isn't clickable). This directly reverts b8f4e74cbc938d3448507d422c98061c2b71c922.
2022-10-27Update toolingMaybe Waffle-1/+1
2022-10-27Introduce UnordMap, UnordSet, and UnordBag (see MCP 533)Michael Woerister-2/+2
MCP 533: https://github.com/rust-lang/compiler-team/issues/533 Also, as an example, substitute UnordMap for FxHashMap in used_trait_imports query result.
2022-10-27Rollup merge of #103616 - rust-lang:notriddle/moz-box-sizing, r=GuillaumeGomezMatthias Krüger-3/+1
rustdoc: remove CSS workaround for Firefox 29 CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/ This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/
2022-10-27Rollup merge of #103505 - notriddle:notriddle/rustdoc-self-closing-tags, ↵Matthias Krüger-1/+54
r=GuillaumeGomez rustdoc: parse self-closing tags and attributes in `invalid_html_tags` Fixes #103460
2022-10-27Rollup merge of #103408 - compiler-errors:rpitit-rustdoc, r=GuillaumeGomezMatthias Krüger-53/+69
Clean return-position `impl Trait` in traits correctly in rustdoc Fixes #103403
2022-10-27Migrate line numbers CSS to CSS variablesGuillaume Gomez-31/+17
2022-10-27Rollup merge of #103592 - notriddle:notriddle/notable-traits-notable, ↵Matthias Krüger-1/+1
r=GuillaumeGomez rustdoc: remove redundant CSS selector `.notable-traits .notable` The margin was already being set to 0 only a few lines lower.
2022-10-26rustdoc: remove CSS workaround for Firefox 29Michael Howell-3/+1
CSS variables, which rustdoc now relies on, are only supported in Firefox 31 and later: https://www.mozilla.org/en-US/firefox/31.0/releasenotes/ This means it’s fine to also rely on unprefixed box-sizing, which is supported in Firefox 29 and later: https://www.mozilla.org/en-US/firefox/29.0/releasenotes/
2022-10-27Rollup merge of #103537 - notriddle:notriddle/line-numbers, r=GuillaumeGomezYuki Okushi-32/+19
rustdoc: combine shared CSS between `.*-line-numbers` Example: https://notriddle.com/notriddle-rustdoc-demos/line-numbers/test_dingus/fn.test.html This PR should result in no visible changes. The example is here, so it can be easily tested in different browsers.
2022-10-27Rollup merge of #103432 - jsha:box-is-not-notable, r=GuillaumeGomezYuki Okushi-0/+9
rustdoc: don't mark Box<T> as Iterator, Read, etc Because Box<T> has pass-through implementations, rustdoc was giving it the "Notable Traits" treatment for Iterator, Read, Write, and Future, even when the type of T was unspecified. Pin had the same problem, but just for Future. Fixes #100320
2022-10-26rustdoc: remove redundant CSS selector `.notable-traits .notable`Michael Howell-1/+1
The margin was already being set to 0 only a few lines lower.
2022-10-27fix(rustdoc): add missing URL component for error messagesWeihang Lo-1/+1
2022-10-26privacy: Rename "accessibility levels" to "effective visibilities"Vadim Petrochenkov-41/+47
And a couple of other naming tweaks Related to https://github.com/rust-lang/rust/issues/48054
2022-10-26Update src/librustdoc/html/static/css/rustdoc.cssMichael Howell-1/+2
Co-authored-by: Jacob Hoffman-Andrews <github@hoffman-andrews.com>
2022-10-25rustdoc: add visible focus outline to rustdoc-toggleMichael Howell-0/+8
The change in opacity is inconsistent with most of rustdoc, which uses default browser styles for the focus outline. Unfortunately, just using the default focus outline here won't work, because it gets applied to the summary itself instead of the pseudo-element "real button."
2022-10-25Don't merge inline doc comments for impl blocksGuillaume Gomez-8/+35
2022-10-25rustdoc: combine shared CSS between `.*-line-numbers`Michael Howell-32/+19
2022-10-25stabilise array methodsDylan DPC-1/+0
2022-10-24rustdoc: parse self-closing tags and attributes in `invalid_html_tags`Michael Howell-1/+54
Fixes #103460
2022-10-25Rollup merge of #103495 - Enselic:rustdoc-unix_sigpipe, r=notriddleYuki Okushi-1/+0
rustdoc: Use `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler` Do what was already done for `rustc` in #102587, namely start using `unix_sigpipe` instead of `rustc_driver::set_sigpipe_handler`. After this has been merged, we can completely remove `rustc_driver::set_sigpipe_handler`. PR that added `set_sigpipe_handler`: https://github.com/rust-lang/rust/pull/49606 Tracking issue for `unix_sigpipe`: #97889 Verification of this change --------------------------- 1. Remove `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE 1. Add back `#[unix_sigpipe = "sig_dfl"]` 1. Run `./x.py build` 1. Run `./build/aarch64-apple-darwin/stage1/bin/rustdoc --help | false` 1. Observe ICE fixed ``@rustbot`` labels +T-rustdoc
2022-10-25Rollup merge of #103494 - notriddle:notriddle/test-arrow-hover, r=GuillaumeGomezYuki Okushi-3/+0
rustdoc: remove redundant CSS `a.test-arrow:hover` In 4b402dbe690dd00f567542ca9e41042826a168b5, when this rule was added, it was overriding a rule that made all links in docblock get an underline when hovered. This became redundant when, after reordering the rules, 7585632052298f9c84cc12ac5afcb23786ae1d3d changed the pro-underline rule to exclude the test-arrow link anyway.
2022-10-25Rollup merge of #103493 - notriddle:notriddle/source-sidebar-logo, ↵Yuki Okushi-4/+6
r=GuillaumeGomez rustdoc: remove unused `.sidebar-logo` DOM on source pages
2022-10-25Rollup merge of #103462 - notriddle:notriddle/source-pre-rust-white-space, ↵Yuki Okushi-1/+0
r=Dylan-DPC rustdoc: remove no-op CSS `.source pre.rust { white-space: pre }` This rule, added in 49e6db7f3510a99ab3d3723b2430add985629c39, overrode a rule in normalize.css. https://github.com/rust-lang/rust/blob/49e6db7f3510a99ab3d3723b2430add985629c39/src/librustdoc/html/static/normalize.css#L169-L175 When normalize.css was updated, this rule went away. https://github.com/necolas/normalize.css/commit/a8edd0c5aa06b905e8e1550fd6a5c01e46375194
2022-10-24Address some commentsmejrs-2/+2