about summary refs log tree commit diff
path: root/src/librustdoc/html/render
AgeCommit message (Collapse)AuthorLines
2025-02-12Nuke `Buffer` abstraction from `librustdoc` 💣Yotam Ofek-472/+613
2025-02-08Rustfmtbjorn3-4/+5
2025-02-06Auto merge of #136265 - notriddle:notriddle/clean-up, r=fmeasebors-1/+1
rustdoc: use ThinVec for generic arg parts This reduces the size of both these args, and of path segments, so should measurably help with memory use.
2025-02-05Auto merge of #136253 - notriddle:notriddle/aot-minify, r=GuillaumeGomezbors-8/+2
rustdoc: run css and html minifier at build instead of runtime This way, adding a bunch of comments to the JS files won't make rustdoc slower. Meant to address https://github.com/rust-lang/rust/pull/136161#issuecomment-2622069453
2025-02-05Auto merge of #136244 - yotamofek:pr/rustdoc-join-iter, r=GuillaumeGomezbors-31/+27
librustdoc: create a helper for separating elements of an iterator instead of implementing it multiple times This implements something similar to [`Itertools::format`](https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.format), but on `Fn`s returning iterators instead of directly on iterators, to allow implementing `Display` without the use of a `Cell` (to handle the possibility of `fmt` being called multiple times while receiving `&self`). ~This is WIP, I just want to get a perf run first to see if the regression I saw in #135494 is fixed~ This was originally part of #135494 , but originally caused a perf regression that was since fixed: https://github.com/rust-lang/rust/blob/7d5ae1863aa66847a4edf8d2ef9420717df65c5d/src/librustdoc/html/format.rs#L507
2025-02-04librustdoc: create a helper for separating elements of an iterator instead ↵Yotam Ofek-31/+27
of implementing it multiple times
2025-01-30fix(rustdoc): always use a channel when linking to doc.rust-lang.orgAlexis (Poliorcetics) Bourget-5/+5
2025-01-29rustdoc: use ThinVec for generic arg partsMichael Howell-1/+1
This reduces the size of both these args, and of path segments, so should measurably help with memory use.
2025-01-29rustdoc: run css and html minifier at build instead of runtimeMichael Howell-8/+2
This way, adding a bunch of comments to the JS files won't make rustdoc slower.
2025-01-29Eliminate PatKind::PathOli Scherer-10/+16
2025-01-23Auto merge of #135494 - yotamofek:rustdoc-fmt-from_fn, r=fmeasebors-34/+31
Refactor `fmt::Display` impls in rustdoc This PR does a couple of things, with the intention of cleaning up and streamlining some of the `fmt::Display` impls in rustdoc: 1. Use the unstable [`fmt::from_fn`](https://github.com/rust-lang/rust/issues/117729) instead of open-coding it. 2. ~~Replace bespoke implementations of `Itertools::format` with the method itself.~~ 4. Some more minor cleanups - DRY, remove unnecessary calls to `Symbol::as_str()`, replace some `format!()` calls with lazier options The changes are mostly cosmetic but some of them might have a slight positive effect on performance.
2025-01-22rustdoc: use std's (unstable) `fmt::from_fn` instead of open-coding itYotam Ofek-33/+30
2025-01-22rustdoc: pass around decoration info by refYotam Ofek-1/+1
2025-01-22rustdoc: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-2/+1
2025-01-18Remove more CSS classesGuillaume Gomez-17/+8
2025-01-17Handle reexports items list a bit differently since they cannot have ↵Guillaume Gomez-7/+5
documentation
2025-01-17Replace ul/li list with dl/dd/dt elementsGuillaume Gomez-19/+11
2025-01-16Treat other items as functions for the purpose of type-based searchbinarycat-0/+27
constants and statics are nullary functions, and struct fields are unary functions. functions (along with methods and trait methods) are prioritized over other items, like fields and constants.
2025-01-15Auto merge of #134353 - oli-obk:safe-target-feature-unsafe-by-default, ↵bors-1/+1
r=wesleywiser Treat safe target_feature functions as unsafe by default [less invasive variant] This unblocks * #134090 As I stated in https://github.com/rust-lang/rust/pull/134090#issuecomment-2541332415 I think the previous impl was too easy to get wrong, as by default it treated safe target feature functions as safe and had to add additional checks for when they weren't. Now the logic is inverted. By default they are unsafe and you have to explicitly handle safe target feature functions. This is the less (imo) invasive variant of #134317, as it doesn't require changing the Safety enum, so it only affects FnDefs and nothing else, as it should.
2025-01-14Rollup merge of #135353 - lolbinarycat:rustdoc-disable-minification, r=notriddleJubilee-1/+9
re-add --disable-minification to rustdoc this also makes the rust.docs-minification option work as advertised in config.toml nothing fancy this time, this is intended to be perma-unstable. it's only really here for the benefit of rustdoc devs. mitegates https://github.com/rust-lang/rust/issues/135345 It was removed in https://github.com/rust-lang/rust/commit/f9e1f6ffdf03ec33cb29e20c88fc7bcc938c7f42.
2025-01-14Rollup merge of #134216 - GuillaumeGomez:jump-to-def-pats, r=fmeaseMatthias Krüger-4/+29
Enable "jump to def" feature on patterns Part of https://github.com/rust-lang/rust/issues/89095. Pattern (as in "patterns in pattern matching") were not handled by the feature, it's now added. It all started when I realized that prelude values like `Some` or `Err` were not getting a link generated either (added support for it in the first commit). r? ``@fmease``
2025-01-14Add hir::HeaderSafety to make follow up commits simplerOli Scherer-1/+1
2025-01-11re-add --disable-minification to rustdocbinarycat-1/+9
this also makes the rust.docs-minification option work as advertised in config.toml nothing fancy this time, this is intended to be perma-unstable. it's only really here for the benefit of rustdoc devs. mitegates https://github.com/rust-lang/rust/issues/135345
2025-01-06Rollup merge of #135116 - camelid:sidebar-case, r=fmeaseJacob Pratt-1/+1
rustdoc: Fix mismatched capitalization in sidebar Previously, the main content used "Aliased Type", while the sidebar said "Aliased type". Now, they both say "Aliased Type", which is the more common capitalization in Rustdoc. See the following link for an example. https://doc.rust-lang.org/1.83.0/std/io/type.Result.html
2025-01-06rustdoc: Fix mismatched capitalization in sidebarNoah Lev-1/+1
Previously, the main content used "Aliased Type", while the sidebar said "Aliased type". Now, they both say "Aliased Type", which is the more common capitalization in Rustdoc. See the following link for an example. https://doc.rust-lang.org/1.83.0/std/io/type.Result.html
2025-01-04turn hir::ItemKind::Fn into a named-field variantRalf Jung-1/+1
2024-12-31Fix typosericlehong-1/+1
Signed-off-by: ericlehong <193237094+ericlehong@users.noreply.github.com>
2024-12-31Unsafe binder support in rustdocMichael Goulet-1/+2
2024-12-25Improve rustdoc codeGuillaume Gomez-3/+3
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-16rename rustc_attr to rustc_attr_parsing and create rustc_attr_data_structuresJonathan Dönszelmann-2/+3
2024-12-15Rollup merge of #134285 - oli-obk:push-vwrqsqlwnuxo, r=UrgauStuart Cook-4/+2
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-4/+2
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-12rustdoc-search: fix mismatched path when parent re-exported twiceMichael Howell-0/+8
2024-12-12Rename `handle_call` into `infer_id`Guillaume Gomez-4/+4
2024-12-12fix self shadowed self compareklensy-1/+1
2024-12-12Enable "jump to def" feature on patternsGuillaume Gomez-1/+26
2024-12-05Turn `markdown_split_summary_and_content` into a method of `Markdown`Guillaume Gomez-3/+3
2024-12-05Always display first line of impl blocks even when collapsedGuillaume Gomez-17/+28
2024-12-02rustdoc: Rename set_back_info to restore_module_data.Alona Enraght-Moony-1/+1
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-158/+169