summary refs log tree commit diff
path: root/src/librustdoc/json
AgeCommit message (Collapse)AuthorLines
2022-07-29Box FunctionItem, TyMethodItem, MethodItem, ForeignFunctionItemest31-4/+4
This reduces ItemKind size from 160 bytes to 112 bytes
2022-07-29Box TypedefItem, ImplItem, AssocTypeItem variants of ItemKindest31-6/+6
This reduces ItemKind size from 224 bytes to 160 bytes.
2022-07-22Auto merge of #99598 - GuillaumeGomez:clean-trait-fields-on-demand, r=notriddlebors-2/+4
Make some clean::Trait fields computation on demand r? `@notriddle`
2022-07-22Make some clean::Trait fields computation on demandGuillaume Gomez-2/+4
2022-07-21Remove unused field in ItemKind::KeywordItemGuillaume Gomez-2/+2
2022-07-17rustdoc: extend `#[doc(tuple_variadic)]` to fn pointersMichael Howell-1/+1
The attribute is also renamed `fake_variadic`.
2022-07-16Fix rustdoc JSON inlineGuillaume Gomez-4/+35
2022-07-02rustdoc-json-types: Clean up derives.Nixon Enraght-Moony-1/+1
Closes #96189 Closes #96189 Everything is `Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize` except `Crate` and `Item` which arn't `Hash`, as they have `HashMap`'s. See linked issue for reasoning.
2022-06-29rustdoc-json: Make default value of blanket impl assoc types workMartin Nordholts-1/+1
2022-06-28Auto merge of #98475 - notriddle:notriddle/index-fn-signatures, r=GuillaumeGomezbors-1/+0
rustdoc: reference function signature types from the `p` array 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-28Rollup merge of #98611 - GuillaumeGomez:rustdoc-json-glob-ice, r=notriddleMatthias Krüger-1/+6
Fix glob import ICE in rustdoc JSON format Fixes #98003. r? `@notriddle`
2022-06-28Fix glob import ICE in rustdoc JSON formatGuillaume Gomez-1/+6
2022-06-27Fix kind for associated types in rustdoc JSON output for trait implementationsGuillaume Gomez-2/+5
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