about summary refs log tree commit diff
path: root/src/librustdoc/json
AgeCommit message (Collapse)AuthorLines
2022-06-24rustdoc: reference function signature types from the `p` arrayMichael Howell-1/+0
This reduces the size of the function signature index, because it's common to have many functions that operate on the same types. $ wc -c search-index-old.js search-index-new.js 5224374 search-index-old.js 3932314 search-index-new.js By my math, this reduces the uncompressed size of the search index by 32%. On compressed signatures, the wins are less drastic, a mere 8%: $ wc -c search-index-old.js.gz search-index-new.js.gz 404532 search-index-old.js.gz 371635 search-index-new.js.gz
2022-06-22Filter out keyword items in rustdoc JSON outputGuillaume Gomez-7/+4
2022-06-18Rollup merge of #98195 - GuillaumeGomez:rustdoc-json-primitive, r=notriddleYuki Okushi-3/+3
Fix rustdoc json primitive handling Fixes https://github.com/rust-lang/rust/issues/98006. cc `@matthiaskrgr`
2022-06-17Fix rustdoc handling of primitive documentationGuillaume Gomez-3/+3
2022-06-16Auto merge of #97842 - notriddle:notriddle/tuple-docs, r=jsha,GuillaumeGomezbors-1/+1
Improve the tuple and unit trait docs * Reduce duplicate impls; show only the `(T,)` and include a sentence saying that there exists ones up to twelve of them. * Show `Copy` and `Clone`. * Show auto traits like `Send` and `Sync`, and blanket impls like `Any`. Here's the new version: * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.tuple.html> * <https://notriddle.com/notriddle-rustdoc-test/std/primitive.unit.html>
2022-06-13Ignore impl items because they can be duplicated in case of generic implGuillaume Gomez-10/+43
2022-06-08rustdoc: show tuple impls as `impl Trait for (T, ...)`Michael Howell-1/+1
This commit adds a new unstable attribute, `#[doc(tuple_varadic)]`, that shows a 1-tuple as `(T, ...)` instead of just `(T,)`, and links to a section in the tuple primitive docs that talks about these.
2022-06-02Add Symbol into rustdoc JSON ID to prevent conflicts between reexportsGuillaume Gomez-35/+66
2022-05-23Auto merge of #94053 - GuillaumeGomez:fields-stripped, r=notriddlebors-5/+9
rustdoc: Remove fields_stripped fields (and equivalents) Fixes #90588. r? `@camelid`
2022-05-21Shrink GenericArgs/PathSegment with boxed slicesMichael Howell-2/+2
2022-05-21Remove fields_stripped fields (and equivalents)Guillaume Gomez-5/+9
2022-05-21Remove `crate` visibility modifier in libs, testsJacob Pratt-11/+13
2022-05-04rustdoc-json: Fix HRTBs for WherePredicate::BoundPredicateMartin Nordholts-2/+8
2022-04-17Stop using CRATE_DEF_INDEX.Camille GILLOT-2/+1
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
2022-04-16Rename `def_id` into `item_id` when the type is `ItemId` for readabilityGuillaume Gomez-16/+16
2022-04-12rustdoc: discr. required+provided assoc consts+tysLeón Orell Valerian Liehr-4/+7
2022-03-29Remove header field from clean::FunctionGuillaume Gomez-16/+21
2022-03-14rustdoc-json-types: implementors -> implementationsNixon Enraght-Moony-2/+2
Closes #94198
2022-03-13rustdoc-json-types: ty -> type_Nixon Enraght-Moony-4/+5
Fixes #94889
2022-03-04rustdoc-json: Include GenericParamDefKind::Type::synthetic in JSONMartin Nordholts-1/+2
The rustdoc JSON for ``` pub fn f(_: impl Clone) {} ``` will effectively be ``` pub fn f<impl Clone: Clone>(_: impl Clone) ``` where a synthetic generic parameter called `impl Clone` with generic trait bound `Clone` is added to the function declaration. The generated HTML filters out these generic parameters by doing `self.params.iter().filter(|p| !p.is_synthetic_type_param())`, because the synthetic generic parameter is not of interest to regular users. For the same reason, we should expose whether or not a generic parameter is synthetic or not also in the rustdoc JSON, so that rustdoc JSON clients can also have the option to hide synthetic generic parameters.
2022-03-03make generic projection types print correctlyMichael Goulet-3/+8
2022-02-27make GATs print properly in traitsMichael Goulet-2/+3
2022-02-23Rollup merge of #94137 - aDotInTheVoid:abi-enum, r=CraftSpiderMatthias Krüger-23/+25
rustdoc-json: Better Header Type - Make ABI an enum, instead of being stringly typed - Replace Qualifier HashSet with 3 bools - Merge ABI field into header, as they always occor together r? ``@CraftSpider`` ``@rustbot`` modify labels: +A-rustdoc-json +T-rustdoc
2022-02-18rustdoc-json: Better Header TypeNixon Enraght-Moony-23/+25
- Make ABI an enum, instead of being stringly typed - Replace Qualifier HashSet with 3 bools - Merge ABI field into header, as they always occor together
2022-02-13rustdoc-json: buffer outputNixon Enraght-Moony-3/+6
2022-01-21Remove FIXME and fix inconsistency of local blanket impls by using HIR for themRune Tynan-14/+1
2022-01-20Rollup merge of #93099 - tomkris:rustdoc-fix, r=jshaMatthias Krüger-4/+8
rustdoc: auto create output directory when "--output-format json" This PR allows rustdoc to automatically create output directory in case it does not exist (when run with `--output-format json`). This fixes rustdoc crash: ```` $ rustdoc --output-format json -Z unstable-options src/main.rs error: couldn't generate documentation: No such file or directory (os error 2) | = note: failed to create or modify "doc/main.json" error: aborting due to previous error ```` With this fix behavior of `rustdoc --output-format json` becomes consistent with `rustdoc --output-format html` (which already auto-creates output directory if it's missing)
2022-01-20Rollup merge of #92860 - CraftSpider:rustdoc-json-impl-ice, r=jshaMatthias Krüger-1/+14
Fix errors on blanket impls by ignoring the children of generated impls Related to #83718 We can safely skip the children, as they don't contain any new info, and may be subtly different for reasons hard to track down, in ways that are consistently worse than the actual generic impl.
2022-01-19rustdoc: auto create output directory when "--output-format json"Artem Kryvokrysenko-4/+8
This PR allows rustdoc to automatically create output directory in case it does not exist (when run with `--output-format json`). This fixes rustdoc crash: ```` $ rustdoc --output-format json -Z unstable-options src/main.rs error: couldn't generate documentation: No such file or directory (os error 2) | = note: failed to create or modify "doc/main.json" error: aborting due to previous error ```` With this fix behavior of `rustdoc --output-format json` becomes consistent with `rustdoc --output-format html` (which already auto-creates output directory if it's missing)
2022-01-17Update term for use in more placeskadmin-1/+10
Replace use of `ty()` on term and use it in more places. This will allow more flexibility in the future, but slightly worried it allows items which are consts which only accept types.
2022-01-14rustdoc: avoid many `Symbol` to `String` conversions.Nicholas Nethercote-2/+2
Particularly when constructing file paths and fully qualified paths. This avoids a lot of allocations, speeding things up on almost all examples.
2022-01-13Move FIXME to if statementRune Tynan-4/+4
2022-01-13Update comment to make it a FIXMERune Tynan-2/+4
2022-01-13inline ItemId method, clarify comments a bitRune Tynan-3/+10
2022-01-13Fix errors on blanket impls by ignoring the children of their generated ↵Rune Tynan-1/+5
implementations
2021-12-30Auto merge of #92377 - compiler-errors:rustdoc-lifetimes, r=camelid,jyn514bors-1/+1
remove in_band_lifetimes from librustdoc r? `@camelid` closes #92368
2021-12-28remove in_band_lifetimes from librustdocMichael Goulet-1/+1
2021-12-27Move `ExternalLocation` to `clean::types`Noah Lev-2/+1
It was previously defined in `render::search_index` but wasn't used at all there. `clean::types` seems like a better fit since that's where `ExternalCrate` is defined.
2021-12-27Rename `rustdoc::html::render::cache` to `search_index`Noah Lev-1/+1
The old name wasn't very clear, while the new one makes it clear that this is the code responsible for creating the search index.
2021-12-19Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obkbors-1/+1
Remove `SymbolStr` This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences. Best reviewed one commit at a time. r? `@oli-obk`
2021-12-15Remove `SymbolStr`.Nicholas Nethercote-1/+1
By changing `as_str()` to take `&self` instead of `self`, we can just return `&str`. We're still lying about lifetimes, but it's a smaller lie than before, where `SymbolStr` contained a (fake) `&'static str`!
2021-12-11rustdoc: Pretty-print assoc const defaults on-demandNoah Lev-1/+3
This should improve performance, clean up the code, and help pave the way for #83035.
2021-11-26Rename `Type::ResolvedPath` to `Type::Path`Noah Lev-4/+4
At last! The new name is shorter, simpler, and consistent with `hir::Ty`.
2021-11-25Stop re-exporting `Type::ResolvedPath`Noah Lev-5/+9
I would like to rename it to `Type::Path`, but then it can't be re-exported since the name would conflict with the `Path` struct. Usually enum variants are referred to using their qualified names in Rust (and parts of rustdoc already do that with `clean::Type`), so this is also more consistent with the language.
2021-11-24Remove `ResolvedPath.did`Noah Lev-9/+5
2021-11-07rustdoc: Use `ty::ImplPolarity` instead of custom enumNoah Lev-3/+3
2021-11-07Use an enum to record polarity in `clean::Impl`Noah Lev-2/+5
2021-11-07rustdoc: Refactor `Impl.{synthetic,blanket_impl}` into enumNoah Lev-11/+9
This change has two advantages: 1. It makes the possible states clearer, and it makes it impossible to construct invalid states, such as a blanket impl that is also an auto trait impl. 2. It shrinks the size of `Impl` a bit, since now there is only one field, rather than two.
2021-11-06rustdoc: Remove redundant `Impl.span` fieldNoah Lev-1/+0
It can be computed on-demand in `Item::span()`.
2021-10-29Fix invalid handling of genericsGuillaume Gomez-0/+1