about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2023-02-15use chars instead of strings where applicableMatthias Krüger-3/+3
2023-02-15Rollup merge of #108076 - GuillaumeGomez:more-let-chain, r=notriddleMatthias Krüger-251/+220
rustdoc: Use more let chain Got the idea after yesterday's review. r? `@notriddle`
2023-02-15Copy `ty::AssocItem` even in rustdocMaybe Waffle-3/+3
2023-02-15Auto merge of #108006 - cjgillot:def-impl, r=oli-obkbors-3/+3
Avoid accessing HIR when it can be avoided Experiment to see if it helps some incremental cases. Will be rebased once https://github.com/rust-lang/rust/pull/107942 gets merged. r? `@ghost`
2023-02-15Use more let chainGuillaume Gomez-251/+220
2023-02-15Rollup merge of #107163 - mikebenfield:parameters-pr, r=TaKO8KiDylan DPC-2/+2
Remove some superfluous type parameters from layout.rs. Specifically remove V, which can always be VariantIdx, and F, which can always be Layout.
2023-02-15Correctly handle reexports of `#[doc(hidden)]` is reexport does not use ↵Guillaume Gomez-4/+15
`#[doc(inline)]`
2023-02-14Correctly handle reexport traversal by fixing multiple bugs, especially for ↵Guillaume Gomez-59/+85
items with a path of 1 element
2023-02-14Add `of_trait` to DefKind::Impl.Camille GILLOT-3/+3
2023-02-14Prevent some attributes from being merged with others on reexportsGuillaume Gomez-8/+89
2023-02-14Rollup merge of #108025 - notriddle:notriddle/intra-doc-link-tooltips, ↵Matthias Krüger-9/+35
r=GuillaumeGomez rustdoc: add more tooltips to intra-doc links This commit makes intra-doc link tooltips consistent with generated links in function signatures and item tables, with the format `itemtype foo::bar::baz`. This way, you can tell if a link points at a trait or a type (for example) by mousing over it. See also https://github.com/rust-lang/rust/pull/39697 Partially solves https://internals.rust-lang.org/t/rustdoc-suggestion-highlight-links-fn-s-mod-s-type-s-etc-appropriately-within-and-documentation/17931 (though the Internals thread asks for color-coding, while this PR adds a tooltip instead, it's accomplishing the same thing). Before: <img width="950" alt="image" src="https://user-images.githubusercontent.com/1593513/218653059-911cea01-7231-438a-ad98-be98ab73783f.png"> After: <img width="432" alt="image" src="https://user-images.githubusercontent.com/1593513/218653201-34ca3aa7-18f1-4cb1-be68-a1411bbe797e.png">
2023-02-14Auto merge of #107765 - petrochenkov:nomoclone, r=oli-obkbors-173/+19
rustc/rustdoc: Perform name resolver cleanups enabled by #94857 Unblocks https://github.com/rust-lang/rust/pull/105462. r? `@oli-obk`
2023-02-13rustdoc: add more tooltips to intra-doc linksMichael Howell-9/+35
This commit makes intra-doc link tooltips consistent with generated links in function signatures and item tables, with the format `itemtype foo::bar::baz`. This way, you can tell if a link points at a trait or a type (for example) by mousing over it. See also fce944d4e79b3a87ddf511206724edf33acfd704
2023-02-13Rollup merge of #108013 - notriddle:notriddle/search-index-itemtype, ↵Matthias Krüger-5/+16
r=GuillaumeGomez rustdoc: use a string with one-character codes for search index types $ wc -c search-index.old.js search-index.new.js 3940530 search-index.old.js 3843222 search-index.new.js ((3940530-3843222)/3940530)*100 = 2.47% $ wc -c search-index.old.js.gz search-index.new.js.gz 380251 search-index.old.js.gz 379434 search-index.new.js.gz ((380251-379434)/380251)*100 = 0.214%
2023-02-13rustdoc: use a string with one-character codes for search index typesMichael Howell-5/+16
$ wc -c search-index.old.js search-index.new.js 3940530 search-index.old.js 3843222 search-index.new.js ((3940530-3843222)/3940530)*100 = 2.47% $ wc -c search-index.old.js.gz search-index.new.js.gz 380251 search-index.old.js.gz 379434 search-index.new.js.gz ((380251-379434)/380251)*100 = 0.214%
2023-02-13Auto merge of #107924 - ↵bors-3/+3
eggyal:move_fold_visit_traits_to_type_lib_with_trait_alias, r=oli-obk Move folding & visiting traits into type library This is a rework of #107712, following feedback on that PR. In particular, this version uses trait aliases to reduce the API churn for trait consumers. Doing so requires a workaround for #107747 until its fix in #107803 is merged into the stage0 compiler; this workaround, which uses conditional compilation based on the `bootstrap` configuration predicate, sits in dedicated commit b409329c for ease of reversion. The possibility of the `rustc_middle` crate retaining its own distinct versions of each folding/visiting trait, blanket-implemented on all types that implement the respective trait in the type library, was also explored: however since this would necessitate making each `rustc_middle` trait a subtrait of the respective type library trait (so that such blanket implementations can delegate their generic methods), no benefit would be gained. r? types
2023-02-13Rollup merge of #107838 - estebank:terminal_hyperlinks, r=nagisaMatthias Krüger-1/+7
Introduce `-Zterminal-urls` to use OSC8 for error codes Terminals supporting the OSC8 Hyperlink Extension can support inline anchors where the text is user defineable but clicking on it opens a browser to a specified URLs, just like `<a href="URL">` does in HTML. https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
2023-02-13Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, ↵Matthias Krüger-109/+81
r=GuillaumeGomez rustdoc: merge doctest tooltip with notable traits tooltip Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000 <details><summary>a user report where the tooltip arrow overlaps the text</summary> ![](https://cdn.discordapp.com/attachments/443150878111694848/1066420139530145812/this-example-is-not-tested-busted-rendering.png) </details> Fixes #91100 Preview: <https://notriddle.com/notriddle-rustdoc-demos/simplify-doctest-tooltip/std/vec/struct.Vec.html#indexing> Screenshot: ![image](https://user-images.githubusercontent.com/1593513/214975516-72667632-4609-49fa-8c37-e8d2ba1ba7dc.png)
2023-02-13Rename folder traits' `tcx` method to `interner`Alan Egerton-1/+1
2023-02-13Make folding traits generic over the InternerAlan Egerton-1/+1
2023-02-13Alias folding/visiting traits instead of re-exportAlan Egerton-1/+1
2023-02-13Auto merge of #107869 - nnethercote:reduce-interning, r=compiler-errorsbors-20/+20
Reduce interning r? `@compiler-errors`
2023-02-13Reduce direct `mk_ty` usage.Nicholas Nethercote-20/+20
We use more specific `mk_*` functions in most places, might as well use them as much as possible.
2023-02-12Rollup merge of #107964 - notriddle:notriddle/title-line-height, ↵Matthias Krüger-0/+8
r=GuillaumeGomez rustdoc: use tighter line height in h1 and h2 This keeps the line height for body text the same, as required by WCAG, but for headers, it makes sense to have wrapped lines be a bit tighter packed. ## Before ![image](https://user-images.githubusercontent.com/1593513/218332683-88a02467-7811-4e6b-81f8-67dded691465.png) ## After ![image](https://user-images.githubusercontent.com/1593513/218332698-a1b2a265-0658-4306-8473-b835f663172d.png)
2023-02-12Rollup merge of #107934 - ↵Matthias Krüger-4/+16
notriddle:notriddle/intra-doc-link-meta-description, r=camelid,GuillaumeGomez rustdoc: account for intra-doc links in `<meta name="description">` Similar to #86451, but for the SEO descriptions instead of the search descriptions.
2023-02-12Rollup merge of #107930 - GuillaumeGomez:js-func-improvement, r=notriddleMatthias Krüger-6/+4
Improve JS function itemTypeFromName code a bit Very small code improvement replacing a `for` loop with `findIndex` method. r? ````@notriddle````
2023-02-13rustdoc: Eliminate remaining uses of resolverVadim Petrochenkov-173/+19
2023-02-12rustdoc: use tighter line height in h1 and h2Michael Howell-0/+8
2023-02-12Auto merge of #107933 - petrochenkov:rmdlc, r=GuillaumeGomezbors-15/+2
rustdoc: Remove cache for preprocessed markdown links It's quite possible that it's no longer useful after https://github.com/rust-lang/rust/pull/94857 is merged.
2023-02-11rustdoc: account for intra-doc links in `<meta name="description">`Michael Howell-4/+16
2023-02-11rustdoc: Remove cache for preprocessed markdown linksVadim Petrochenkov-15/+2
2023-02-11Improve JS function itemTypeFromName code a bitGuillaume Gomez-6/+4
2023-02-11Rollup merge of #107912 - clubby789:doc-bad-enum-field, r=camelid,GuillaumeGomezMatthias Krüger-4/+25
rustdoc: Don't resolve link to field on different variant Fix #107903 This also gives a more specific diagnostic when the enum has any fields
2023-02-11Rollup merge of #107909 - notriddle:notriddle/register-header-empty-cond, ↵Matthias Krüger-5/+1
r=camelid rustdoc: remove redundant `if s.is_empty()` from `find_testable_code`
2023-02-11Rollup merge of #107897 - GuillaumeGomez:reexported-macros-docs, r=notriddleMatthias Krüger-4/+6
Reexported macros docs Part of #59368 (doesn't fix it, only improve the current situation a bit). Macros were not correctly handled in reexports and the reexport attributes were not merged with the item either. This PR fixes both. r? `@notriddle`
2023-02-11Rollup merge of #107864 - notriddle:notriddle/rustdoc-write-stutter, ↵Matthias Krüger-15/+12
r=GuillaumeGomez rustdoc: clean up `write!` calls with less stuttering
2023-02-11rustdoc: Don't resolve link to field on different variantclubby789-4/+25
2023-02-11Auto merge of #94857 - petrochenkov:doclink2, r=oli-obkbors-768/+65
Resolve documentation links in rustc and store the results in metadata This PR implements MCP https://github.com/rust-lang/compiler-team/issues/584. Doc links are now resolved in rustc and stored into metadata, so rustdoc simply retrieves them through a query (local or extern), Code that is no longer used is removed, and some code that no longer needs to be public is privatized. The removed code includes resolver cloning, so this PR fixes https://github.com/rust-lang/rust/issues/83761.
2023-02-11Auto merge of #107919 - Dylan-DPC:rollup-fkl9swa, r=Dylan-DPCbors-14/+4
Rollup of 9 pull requests Successful merges: - #105019 (Add parentheses properly for borrowing suggestion) - #106001 (Stop at the first `NULL` argument when iterating `argv`) - #107098 (Suggest function call on pattern type mismatch) - #107490 (rustdoc: remove inconsistently-present sidebar tooltips) - #107855 (Add a couple random projection tests for new solver) - #107857 (Add ui test for implementation on projection) - #107878 (Clarify `new_size` for realloc means bytes) - #107888 (revert #107074, add regression test) - #107900 (Zero the `REPARSE_MOUNTPOINT_DATA_BUFFER` header) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-02-11Auto merge of #107507 - BoxyUwU:deferred_projection_equality, r=lcnrbors-0/+2
Implement `deferred_projection_equality` for erica solver Somewhat of a revival of #96912. When relating projections now emit an `AliasEq` obligation instead of attempting to determine equality of projections that may not be as normalized as possible (i.e. because of lazy norm, or just containing inference variables that prevent us from resolving an impl). Only do this when the new solver is enabled
2023-02-11Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, ↵Dylan DPC-14/+4
r=GuillaumeGomez rustdoc: remove inconsistently-present sidebar tooltips Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-02-10rustdoc: remove redundant `if s.is_empty()` from `find_testable_code`Michael Howell-5/+1
2023-02-10Also get current import attributesGuillaume Gomez-3/+5
2023-02-10Correctly handle reexports for macrosGuillaume Gomez-1/+1
2023-02-10add `AliasEq` to `PredicateKind`Boxy-0/+2
2023-02-10Auto merge of #107652 - estebank:re_error, r=oli-obkbors-0/+1
Introduce `ReError` CC #69314 r? `@nagisa`
2023-02-10Skip doc link resolution for some crate types and non-exported itemsVadim Petrochenkov-3/+12
2023-02-10Stop resolving doc links on `mod` items twiceVadim Petrochenkov-13/+3
2023-02-10Resolve documentation links in rustc and store the results in metadataVadim Petrochenkov-753/+51
This commit implements MCP https://github.com/rust-lang/compiler-team/issues/584 It also removes code that is no longer used, and that includes code cloning resolver, so issue #83761 is fixed.
2023-02-10Rollup merge of #107852 - notriddle:notriddle/rm-tab, r=GuillaumeGomezMatthias Krüger-7/+5
rustdoc: remove unused fn parameter `tab`