about summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2023-02-18rustdoc: Cleanup broken link callbacksVadim Petrochenkov-29/+17
2023-02-18rustdoc: Do not use Footnotes and HeadingLinks when extracting doc linksVadim Petrochenkov-8/+3
they do not add any `Link` events
2023-02-17Auto merge of #108075 - WaffleLapkin:de-arena-allocates-you-OwO, r=Nilstriebbors-3/+3
Remove `arena_cache` modifier from `associated_item` query & copy `ty::AssocItem` instead of passing by ref r? `@ghost`
2023-02-17Add comment explaining the search index tweakMichael Howell-0/+6
2023-02-17Add `Clause::ConstArgHasType` variantBoxy-0/+1
2023-02-17Auto merge of #107753 - kylematsuda:type-of, r=BoxyUwUbors-28/+54
Switch to `EarlyBinder` for `type_of` query Part of the work to finish #105779 and implement https://github.com/rust-lang/types-team/issues/78. Several queries `X` have a `bound_X` variant that wraps the output in `EarlyBinder`. This adds `EarlyBinder` to the return type of the `type_of` query and removes `bound_type_of`. r? `@lcnr`
2023-02-16Correct eslint warningMichael Howell-1/+1
2023-02-16rustdoc: search by macro when query ends with `!`Michael Howell-4/+24
Related to #96399
2023-02-16rustdoc: hide `reference` methods in search indexMichael Howell-0/+4
2023-02-16fix new usage of type_ofKyle Matsuda-1/+1
2023-02-16changes from reviewKyle Matsuda-1/+6
2023-02-16remove bound_type_of query; make type_of return EarlyBinder; change type_of ↵Kyle Matsuda-39/+28
in metadata
2023-02-16change usages of type_of to bound_type_ofKyle Matsuda-26/+58
2023-02-17Rollup merge of #108104 - matthiaskrgr:into, r=compiler-errorsMatthias Krüger-1/+1
don't into self don't into()-convert types to themselves
2023-02-17Rollup merge of #107489 - compiler-errors:non_lifetime_binders, r=cjgillotMatthias Krüger-5/+5
Implement partial support for non-lifetime binders This implements support for non-lifetime binders. It's pretty useless currently, but I wanted to put this up so the implementation can be discussed. Specifically, this piggybacks off of the late-bound lifetime collection code in `rustc_hir_typeck::collect::lifetimes`. This seems like a necessary step given the fact we don't resolve late-bound regions until this point, and binders are sometimes merged. Q: I'm not sure if I should go along this route, or try to modify the earlier nameres code to compute the right bound var indices for type and const binders eagerly... If so, I'll need to rename all these queries to something more appropriate (I've done this for `resolve_lifetime::Region` -> `resolve_lifetime::ResolvedArg`) cc rust-lang/types-team#81 r? `@ghost`
2023-02-16don't into selfMatthias Krüger-1/+1
don't into()-convert types to themselves
2023-02-16Rollup merge of #108099 - matthiaskrgr:str_to_char, r=GuillaumeGomezMatthias Krüger-3/+3
use chars instead of strings where applicable
2023-02-16Rollup merge of #108057 - GuillaumeGomez:fix-reexport-attr-merge, r=notriddleMatthias Krüger-27/+145
Prevent some attributes from being merged with others on reexports Final fix for https://github.com/rust-lang/rust/issues/59368. As discussed on zulip [here](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Filtering.20sub.20attributes.20in.20ast.3A.3AAttribute), we need to clone the `Attribute` to be able to filter some parts of it. Then we need to go through the attributes to able to only keep what we want (everything except a few attributes in short). As for the second commit, when I wrote the test, I realized that the code to traverse all reexports one by one to collect all their attributes was not completely working so I fixed the few issues remaining. r? `@notriddle`
2023-02-16Rename some region-specific stuffMichael Goulet-5/+5
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