summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2024-12-31Fix typosericlehong-4/+4
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-31Unsafe binder support in rustdocMichael Goulet-6/+14
2024-12-25Improve rustdoc codeGuillaume Gomez-10/+9
2024-12-20Rollup merge of #134321 - dtolnay:docassocconst, r=fmeaseJacob Pratt-28/+63
Hide `= _` as associated constant value inside impl blocks Closes #134320. ### Before: <img src="https://github.com/user-attachments/assets/19d28811-45d2-4563-9726-f40c6af411c6" width="300">&nbsp;<img src="https://github.com/user-attachments/assets/1ecf8764-97ce-47f0-87fa-3b174d2fc578" width="300"> ### After: <img src="https://github.com/user-attachments/assets/6408c4ca-b1c4-42e4-884b-248833a4865f" width="300">&nbsp;<img src="https://github.com/user-attachments/assets/df2f6981-16f6-409f-8abb-73c0a4a71d6b" width="300"> r? `@fmease`
2024-12-19Rename TyMethodItem -> RequiredMethodItemDavid Tolnay-5/+5
2024-12-19Rename TyAssocTypeItem -> RequiredAssocTypeItemDavid Tolnay-7/+9
2024-12-19Suppress `= _` on associated constants in implsDavid Tolnay-10/+40
2024-12-19Split AssocConstItem into ProvidedAssocConstItem and ImplAssocConstItemDavid Tolnay-3/+5
2024-12-19Rename TyAssocConstItem -> RequiredAssocConstItemDavid Tolnay-5/+6
2024-12-19Rollup merge of #134432 - GuillaumeGomez:intra-doc-in-footnotes, r=notriddle许杰友 Jieyou Xu (Joe)-16/+50
Fix intra doc links not generated inside footnote definitions Fixes #132208. The problem was that we were running the `Footnote` "pass" before the `LinkReplacer` one. Sadly, the change is bigger than it should because we can't specialize the `Iterator` trait implementation, forcing me to add a new type to handle the other `Iterator` kind (the one which still has the `Range`). r? ``@notriddle``
2024-12-17Auto merge of #134381 - jdonszelmann:move-attribute-types, r=oli-obkbors-3/+4
Split up attribute parsing code and move data types to `rustc_attr_data_structures` This change renames `rustc_attr` to `rustc_attr_parsing`, and splits up the parsing code. At the same time, all the data types used move to `rustc_attr_data_structures`. This is in preparation of also having a third crate: `rustc_attr_validation` I initially envisioned this as two separate PRs, but I think doing it in one go reduces the number of ways others would have to rebase their changes on this. However, I can still split them. r? `@oli-obk` (we already discussed how this is a first step in a larger plan) For a more detailed plan on how attributes are going to change, see https://github.com/rust-lang/rust/issues/131229 Edit: this looks like a giant PR, but the changes are actually rather trivial. Each commit is reviewable on its own, and mostly moves code around. No new logic is added.
2024-12-17Fix intra doc links not generated inside footnote definitionsGuillaume Gomez-16/+50
2024-12-16Rollup merge of #134277 - notriddle:notriddle/inline-into, r=GuillaumeGomezMatthias Krüger-1/+6
rustdoc-search: handle `impl Into<X>` better This PR fixes two bugs I ran into while searching the compiler docs: - It omitted an `impl Trait` entry in the type signature field, producing `TyCtxt, , Symbol -> bool` - It didn't let me search for `TyCtxt, DefId, Symbol -> bool` even though that's a perfectly good description of the function I was looking for (the function actually used `impl Into<DefId>` r? ``@GuillaumeGomez`` cc ``@lolbinarycat``
2024-12-16rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structuresJonathan Dönszelmann-3/+4
2024-12-15Rollup merge of #134285 - oli-obk:push-vwrqsqlwnuxo, r=UrgauStuart Cook-8/+3
Add some convenience helper methods on `hir::Safety` Makes a lot of call sites simpler and should make any refactorings needed for https://github.com/rust-lang/rust/pull/134090#issuecomment-2541332415 simpler, as fewer sites have to be touched in case we end up storing some information in the variants of `hir::Safety`
2024-12-14Add some convenience helper methods on `hir::Safety`Oli Scherer-8/+3
2024-12-14Rollup merge of #134231 - notriddle:notriddle/mismatched-path, r=GuillaumeGomezMatthias Krüger-0/+8
rustdoc-search: fix mismatched path when parent re-exported twice
2024-12-13rustdoc-search: show `impl Trait` inline when unhighlightedMichael Howell-1/+6
While normal generics can be skipped in this case, no-names need something to show here. Before: `TyCtxt, , Symbol -> bool` After: `TyCtxt, Into<DefId>, Symbol -> bool`
2024-12-12rustdoc-search: fix mismatched path when parent re-exported twiceMichael Howell-0/+8
2024-12-12fix self shadowed self compareklensy-1/+1
2024-12-05Improve positioning of "..." in collapsed impl blockGuillaume Gomez-3/+8
2024-12-05Use text ellipsis instead of bottom blurringGuillaume Gomez-11/+16
2024-12-05Turn `markdown_split_summary_and_content` into a method of `Markdown`Guillaume Gomez-49/+52
2024-12-05Always display first line of impl blocks even when collapsedGuillaume Gomez-47/+141
2024-12-04Rollup merge of #133804 - GuillaumeGomez:improve-code, r=notriddleMatthias Krüger-28/+22
Improve code for FileName retrieval in rustdoc Some calls were performed twice (first in `is_real_and_local` and then in the function calling it). Also the `FileName` was matched on a few times too. r? `@notriddle`
2024-12-04Rollup merge of #133764 - aDotInTheVoid:rename, r=GuillaumeGomezMatthias Krüger-1/+1
rustdoc: Rename `set_back_info` to `restore_module_data`. Follow-up to #133345, r? `@GuillaumeGomez` Most of the references to `info` got removed as it was clear that `module_data` makes more sense here. Makes it clearer that `save_module_data` and `restore_module_data` are a pair.
2024-12-03Rename `is_real_and_local` function into `filename_real_and_local`Guillaume Gomez-3/+4
2024-12-03Improve code for FileName retrieval in rustdocGuillaume Gomez-28/+21
2024-12-02rustdoc: Rename set_back_info to restore_module_data.Alona Enraght-Moony-1/+1
2024-12-02Remove static HashSet for default IDs listGuillaume Gomez-60/+56
2024-12-01Fix link to `FormatRenderer` methodGuillaume Gomez-1/+1
2024-12-01Rename `FormatRenderer::InfoType` into `ModuleData` and rename ↵Guillaume Gomez-3/+3
`FormatRenderer::make_child_renderer` into `save_module_data`
2024-12-01Add documentation for new `FormatRenderer` trait itemsGuillaume Gomez-0/+6
2024-12-01Move `SharedContext` out of `Rc`Guillaume Gomez-162/+171
2024-12-01Store default ID map in a staticGuillaume Gomez-3/+7
2024-12-01Split ID maps in two parts: the constant one and the updated oneGuillaume Gomez-67/+57
2024-12-01Stop cloning `Context` so muchGuillaume Gomez-85/+111
2024-11-29Rollup merge of #131718 - GuillaumeGomez:impl-items-indent, r=rustdocMatthias Krüger-15/+35
[rustdoc] Change impl items indent Fixes https://github.com/rust-lang/rust/issues/131704. | before | after | |-|-| | ![image](https://github.com/user-attachments/assets/67679827-6aef-4bdb-93dd-e1a4784566b3) | ![image](https://github.com/user-attachments/assets/8a0e9fbc-794a-4b98-abc6-bbbe178736b1) | Can be tested [here](https://rustdoc.crud.net/imperio/impl-items-indent/bar/struct.Bar.html). r? `@notriddle`
2024-11-28Fix new clippy lintsGuillaume Gomez-148/+145
2024-11-26Rollup merge of #133458 - GuillaumeGomez:fix-prelude-tys-links, r=notriddleMichael Goulet-5/+8
Fix `Result` and `Option` not getting a jump to def link generated It was just because we didn't store the "span" in the `PreludeTy` variant. r? ``@notriddle``
2024-11-25Fix `Result` and `Option` not getting a jump to def link generatedGuillaume Gomez-5/+8
2024-11-23do not to_string, use displayklensy-1/+1
2024-11-19Rollup merge of #133201 - nnethercote:rm-TokenKind-InvalidPrefix, ↵Matthias Krüger-4/+3
r=compiler-errors Remove `TokenKind::InvalidPrefix` It's not needed. Best reviewed one commit at a time. r? `@estebank`
2024-11-19Remove `TokenKind::InvalidPrefix`.Nicholas Nethercote-4/+3
It was added in #123752 to handle some cases involving emoji, but it isn't necessary because it's always treated the same as `TokenKind::InvalidIdent`. This commit removes it, which makes things a little simpler.
2024-11-19Rollup merge of #133185 - notriddle:notriddle/roaringbitmap, r=notriddleLeón Orell Valerian Liehr-10/+55
rustdoc-search: use smart binary search in bitmaps Addresses a comment from [jsha's benchmarking], where the `contains` function showed up in the profiler. This commit pulls it from about 5% of the runtime to about 0.5%. Before: https://share.firefox.dev/3ANVjon After: https://share.firefox.dev/3OeM3gk [jsha's benchmarking]: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/search.20profiling/near/481868761
2024-11-19Rollup merge of #133180 - GuillaumeGomez:jump-to-def-links-generics, r=notriddleLeón Orell Valerian Liehr-4/+19
[rustdoc] Fix items with generics not having their jump to def link generated Because the span originally included the generics, during the highlighting, it was not retrieved and therefore its jump to def link was not generated. r? ``@notriddle``
2024-11-18rustdoc-search: add descriptive comments to bitmap classMichael Howell-0/+23
2024-11-18rustdoc-search: use smart binary search in bitmapsMichael Howell-10/+32
Addresses a comment from [jsha's benchmarking], where the `contains` function showed up in the profiler. This commit pulls it from about 5% of the runtime to about 0.5%. [jsha's benchmarking]: https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/search.20profiling/near/481868761
2024-11-18Fix items with generics not having their jump to def link generatedGuillaume Gomez-3/+18
2024-11-18Fix typoGuillaume Gomez-1/+1