about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2025-01-29Add italic for newly added sans serif fontsGuillaume Gomez-3/+21
2025-01-29Add new setting allowing to switch to sans serif fontsGuillaume Gomez-2/+41
2025-01-27rustdoc: add nobuild typescript checking to our JSMichael Howell-680/+1655
By nobuild, I mean that the type annotations are all in comments, not in the "native" typescript syntax. This is a bit uglier, but it lets you rapid-prototype without tsc, works with all the native browser debugging tools, and keeps Node out of Rust's bootstrap chain. This pull request mostly just adds ts-ignore annotations and type declarations. To actually take good advantage of typescript, we'll want to "burn down" this pile of unsafe code until we eventually have a version with almost none of these. This PR also adds tsc to the mingw-check Dockerfile, so that it can't fall out of date like the Closure annotations did. https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/typescript
2025-01-27Add `TooGeneric` variant to `LayoutError` and emit `Unknown` oneFedericoBruzzone-5/+11
- `check-pass` test for a MRE of #135020 - fail test for #135138 - switch to `TooGeneric` for checking CMSE fn signatures - switch to `TooGeneric` for compute `SizeSkeleton` (for transmute) - fix broken tests
2025-01-25Remove extra whitespace from rustdoc breadcrumbs for copypastingKornel-8/+5
2025-01-24Rollup merge of #135998 - GuillaumeGomez:fix-trait-items-mobile-indent, ↵Matthias Krüger-3/+7
r=notriddle [rustdoc] Fix indent of trait items on mobile Before: ![Screenshot From 2025-01-24 15-38-53](https://github.com/user-attachments/assets/f7738ff8-92b6-4aca-8a66-2d3618c54572) After: ![Screenshot From 2025-01-24 15-38-37](https://github.com/user-attachments/assets/0a19dc7e-dddd-4cd5-b087-1915e152d7c1) Seems like we forgot them when we did #131718. Can be tested [here](https://rustdoc.crud.net/imperio/fix-trait-items-mobile-indent/foo/trait.T.html). r? `@notriddle`
2025-01-24Fix indent of trait items on mobileGuillaume Gomez-3/+7
2025-01-23Auto merge of #135494 - yotamofek:rustdoc-fmt-from_fn, r=fmeasebors-100/+81
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-91/+72
2025-01-22rustdoc: pass around decoration info by refYotam Ofek-9/+9
2025-01-22rustdoc: Finalize dyn compatibility renamingLeón Orell Valerian Liehr-2/+1
2025-01-19Remove unused `item-row` CSS classGuillaume Gomez-1/+1
2025-01-18Remove more CSS classesGuillaume Gomez-28/+19
2025-01-17Handle reexports items list a bit differently since they cannot have ↵Guillaume Gomez-8/+6
documentation
2025-01-17Replace ul/li list with dl/dd/dt elementsGuillaume Gomez-33/+29
2025-01-16Treat other items as functions for the purpose of type-based searchbinarycat-0/+43
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/+10
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-15Treat safe target_feature functions as unsafe by defaultOli Scherer-0/+1
2025-01-14Rollup merge of #135499 - lolbinarycat:rustdoc-link-underline-133484, ↵Jubilee-0/+2
r=GuillaumeGomez fix underlining of hovered intra-doc links. fixes https://github.com/rust-lang/rust/issues/133484 i'm not sure how to create a test case for this, or if that is even possible.
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 #135302 - lolbinarycat:rustdoc-search-return-sort-134935, ↵Jubilee-0/+46
r=notriddle for purely return-type based searches, deprioritize clone-like functions closes https://github.com/rust-lang/rust/issues/134935
2025-01-14fix underlining of hovered intra-doc links.binarycat-0/+2
fixes https://github.com/rust-lang/rust/issues/133484
2025-01-14Rollup merge of #134216 - GuillaumeGomez:jump-to-def-pats, r=fmeaseMatthias Krüger-9/+39
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/+9
2025-01-13for purely return-type based searches, deprioritize clone-like functionsbinarycat-0/+46
A clone-like function in a function that takes as an argument the type that it returns. However, functions that return a type variable are not counted as clone-line. Because we're not unifying the whole function at once, a function like `U -> T` would otherwise be counted as "clone-like" because the generics will just unify with anything when done seperatly. Co-authored-by: Michael Howell <michael@notriddle.com>
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-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-12Rename `handle_call` into `infer_id`Guillaume Gomez-4/+4
2024-12-12fix self shadowed self compareklensy-1/+1