about summary refs log tree commit diff
path: root/src/librustdoc/json/mod.rs
AgeCommit message (Collapse)AuthorLines
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-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-10-15Moved format-version constant to rustdoc-json-typesYuval Dolev-1/+1
2021-10-08Rollup merge of #89669 - Urgau:json-remove-type-never, r=GuillaumeGomezGuillaume Gomez-1/+1
Remove special-casing of never primitive in rustdoc-json-types Fixes https://github.com/rust-lang/rust/issues/89349 r? `@GuillaumeGomez`
2021-10-08clippy::complexity fixesMatthias Krüger-1/+1
2021-10-08Remove special-casing of never primitive in rustdoc-json-typesLoïc BRANSTETT-1/+1
2021-10-04Rollup merge of #88234 - hkmatsumoto:rustdoc-impls-for-primitive, r=jyn514Manish Goregaokar-2/+21
rustdoc-json: Don't ignore impls for primitive types Fix the issue discussed at [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.E2.9C.94.20Json.20output.20lacks.20some.20item.20which.20are.20supposed.20to.20be.20there) r? ``@jyn514``
2021-09-29Don't ignore impls for primitive typesHirochika Matsumoto-2/+21
2021-09-26Fix populate of union.implsLoïc BRANSTETT-0/+2
2021-09-02rustdoc: Clean up handling of lifetime boundsNoah Lev-1/+1
Previously, rustdoc recorded lifetime bounds by rendering them into the name of the lifetime parameter. Now, it leaves the name as the actual name and instead records lifetime bounds in an `outlives` list, similar to how type parameter bounds are recorded.
2021-07-05Revert "rustdoc: Store DefId's in ItemId on heap for decreasing Item's size"Justus K-7/+7
This reverts commit 41a345d4c46dad1a98c9993bc78513415994e8ba.
2021-07-05rustdoc: Store DefId's in ItemId on heap for decreasing Item's sizeJustus K-7/+7
2021-07-05rustdoc: Rename `expect_real` to `expect_def_id`, remove `Item::is_fake`Justus K-3/+3
2021-07-05rustdoc: Replace `FakeDefId` with new `ItemId` typeJustus K-7/+7
2021-06-07format versionEllen-1/+1
2021-05-15Minimize amount of fake `DefId`s used in rustdocJustus K-7/+8
2021-05-04Add type to differentiate between fake and real DefId'sJustus K-7/+8
2021-04-29only store locations in extern_locationsTimothée Delabrouille-5/+6
2021-04-24rustdoc: Turn `JsonRenderer::mod_item_in` into `unreachable!()`Joshua Nelson-15/+2
The JSON renderer no longer gets called on modules.
2021-04-22Remove unnecessary item_name parameter to `mod_item_in`Joshua Nelson-1/+1
2021-04-22Remove unnecessary `item_name` parameter to `mod_item_out`Joshua Nelson-4/+0
2021-04-22Remove unnecessary `edition` parameter to rendererJoshua Nelson-2/+0
2021-04-22Remove unnecessary `diag` parameter to `after_krate`Joshua Nelson-1/+1
2021-04-22Remove unnecessary `crate_name` parameter to `after_krate`Joshua Nelson-6/+2
It's always `tcx.crate_name(LOCAL_CRATE)`, it doesn't need to be passed in separately.
2021-03-26Rollup merge of #83055 - aDotInTheVoid:selective-strip-item-doc, r=jyn514Dylan DPC-1/+5
[rustdoc] Don't document stripped items in JSON renderer. Fixes #80664, see [my comment there](https://github.com/rust-lang/rust/issues/80664#issuecomment-797557948) for why Note that we already do something similar in `convert_item`: https://github.com/rust-lang/rust/blob/bb4cdf8ec034dca5c056ec9295f38062e5b7e871/src/librustdoc/json/conversions.rs#L28-L31 ``@rustbot`` modify labels: +T-rustdoc +A-rustdoc-json r? ``@jyn514`` cc ``@CraftSpider``
2021-03-24Rework rustdoc const typeGuillaume Gomez-3/+7
2021-03-24Don't call `item` on modules for json rendererNixon Enraght-Moony-1/+5
Closes #80664
2021-03-24Rollup merge of #83415 - camelid:remove-crate-module-option, r=jyn514Dylan DPC-2/+2
Remove unnecessary `Option` wrapping around `Crate.module` I'm wondering if it was originally there so that we could `take` the module which enables `after_krate` to take an `&Crate`. However, the two impls of `after_krate` only use `Crate.name`, so we can pass just the name instead.
2021-03-23Remove unnecessary `Option` wrapping around `Crate.module`Camelid-2/+2
I'm wondering if it was originally there so that we could `take` the module which enables `after_krate` to take an `&Crate`. However, the two impls of `after_krate` only use `Crate.name`, so we can pass just the name instead.
2021-03-21Bump rustdoc-json format versionCamelid-1/+1
The rustdoc-json-types renames are breaking changes.
2021-03-21Rename `rustdoc_json_types::Item.source` to `span`Camelid-1/+1
2021-03-09Auto merge of #82356 - camelid:render-cleanup, r=GuillaumeGomezbors-0/+4
rustdoc: Cleanup `html::render::Context` - Move most shared fields to `SharedContext` (except for `cache`, which isn't mutated anyway) - Replace a use of `Arc` with `Rc` - Make a bunch of fields private - Add static size assertion for `Context` - Don't share `id_map` and `deref_id_map`
2021-03-06Revert fmt version, add rustdoc-json-types to bootstrap testsRune Tynan-1/+1
2021-03-06Add roundtrip testing and bump format versionRune Tynan-1/+1
2021-03-06Remove Item::kind, use tagged enum. Rename variants to matchRune Tynan-5/+4
2021-03-05Don't unnecessarily clone some fields in `Context`Camelid-0/+4
There was no need to clone `id_map` because it was reset before each item was rendered. `deref_id_map` was not reset, but it was keyed by `DefId` and thus was unlikely to have collisions (at least for now). Now we just clone the fields that need to be cloned, and instead create fresh versions of the others.
2021-03-05Make ItemKind::ExternCrate looks like hir::ItemKind::ExternCrate to make ↵Guillaume Gomez-1/+1
transition over hir::ItemKind simpler
2021-03-01Remove `krate.version`; fix `crate_version` in JSONJoshua Nelson-2/+2
Previously, `JsonRenderer::after_krate` called `krate.version.clone()`. The problem was it did that after the version was already moved into the cache, so it would always be None. The fix was to get the version from the cache instead.