about summary refs log tree commit diff
path: root/src/librustdoc/json
AgeCommit message (Collapse)AuthorLines
2021-02-05Rollup merge of #81500 - CraftSpider:union-kind, r=jyn514Mara Bos-5/+4
Remove struct_type from union output Also bumps the format number and adds a test Rationale: It's illegal to have unions of the form `union Union(i32, f32);`, or `union Union;`. The struct_type field was recently removed from the rustdoc Union AST, at which time this field was changed to always just read "union". It makes sense to completely remove it, as it provides no information.
2021-01-28Remove struct_type from union output and bump formatRune Tynan-5/+4
2021-01-28Fix has_body for trait methodsRune Tynan-11/+9
2021-01-27Update crate name and add READMERune Tynan-2/+2
2021-01-27Simplify conversionRune Tynan-8/+1
2021-01-27Allow rustc::default_hash_types in the offending statementRune Tynan-0/+3
2021-01-27Split JSON into separately versioned crateRune Tynan-546/+54
2021-01-27More cleanupGuillaume Gomez-6/+3
2021-01-27Update to new rustdoc APIsGuillaume Gomez-1/+1
2021-01-27Remove CACHE_KEY globalGuillaume Gomez-40/+40
2021-01-23Rollup merge of #81275 - jyn514:time-render, r=wesleywiserJonas Schievink-0/+4
Fix <unknown> queries and add more timing info to render_html Closes https://github.com/rust-lang/rust/issues/81251. ## Fix `<unknown>` queries This happened because `alloc_query_strings` was never called. ## Add more timing info to render_html This still has some issues I'm not sure how to work out: - `create_renderer` and `renderer_after_krate` aren't shown by default. I want something like `verbose_generic_activity_with_arg`, but it doesn't exist. I'm also not sure how to show activities that aren't on by default - I tried `-Z self-profile -Z self-profile-args=all`, but it didn't show up. r? `@wesleywiser`
2021-01-23Add more timing info to render_htmlJoshua Nelson-0/+4
- Show `create_renderer` and `renderer_after_crate` by default - Don't rewrite `extra_verbose_generic_activity`
2021-01-22Rollup merge of #81227 - CraftSpider:struct-type-clean, r=jyn514Mara Bos-9/+9
Remove doctree::StructType Also removes it from the Union type, as unions can only ever be 'Plain'. Adds a new StructType to JSON, 'union', as the easiest way to encode the type of a union there. This leaves only one item in doctree, `Module`. r? `@jyn514`
2021-01-22Rollup merge of #81225 - CraftSpider:json-opt-docs, r=jyn514Mara Bos-4/+5
Make 'docs' nullable in rustdoc-json output Matches the backing better, and makes it so there's a difference between 'empty docs' and 'no docs'.
2021-01-21Fix rustc::internal lints on rustdocJoshua Nelson-3/+3
2021-01-21Bump format versionRune Tynan-1/+1
2021-01-20Add explanation of None vs Some("")Rune Tynan-1/+2
2021-01-20Remove StructType entirely and replace it with CtorKindRune Tynan-6/+6
2021-01-20Move StructType to clean, remove it from Unions, make JSON output whether ↵Rune Tynan-6/+6
something is a union
2021-01-20Make 'docs' optionalRune Tynan-2/+2
2021-01-19Remove unnecessary `after_run` functionJoshua Nelson-5/+6
It's called at the same time and in the same place as `after_krate`, so they can be combined.
2021-01-15Rename VariantKind -> VariantJoshua Nelson-3/+3
There's no `Variant`, so it seems silly to have `Kind`.
2021-01-15Remove useless `clean::Variant` structJoshua Nelson-3/+3
It had exactly one field and no special behavior, so there was no point.
2021-01-09Replace under-used ImplPolarity enum with a booleanGuillaume Gomez-2/+2
2020-12-23Box ItemKind to reduce the size of `Item`Joshua Nelson-4/+4
This brings the size of `Item` from ``` [src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 680 ``` to ``` [src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 280 ```
2020-12-23Auto merge of #80099 - jyn514:visibility-on-demand, r=GuillaumeGomezbors-15/+13
Remove `DefPath` from `Visibility` and calculate it on demand Depends on #80090 and should not be merged before. Helps with https://github.com/rust-lang/rust/issues/79103 and https://github.com/rust-lang/rust/issues/76382. cc https://github.com/rust-lang/rust/pull/80014#issuecomment-746810284 - `@nnethercote` I figured it out! It was simpler than I expected :) This brings the size of `clean::Visibility` down from 40 bytes to 8. Note that this does *not* remove `clean::Visibility`, even though it's now basically the same as `ty::Visibility`, because the `Invsible` variant means something different from `Inherited` and I thought it would be be confusing to merge the two. See the new comments on `impl Clean for ty::Visibility` for details.
2020-12-23Auto merge of #80095 - jyn514:stability-on-demand, r=GuillaumeGomezbors-11/+2
[rustdoc] Calculate stability, const_stability, and deprecation on-demand Previously, they would always be calculated ahead of time, which bloated the size of `clean::Item`. Builds on https://github.com/rust-lang/rust/pull/80090 and should not be merged before. Helps with https://github.com/rust-lang/rust/issues/79103 and https://github.com/rust-lang/rust/issues/76382. cc https://github.com/rust-lang/rust/pull/80014#issuecomment-746810284 This brings `Item` down to 568 bytes, down from 616.
2020-12-18Auto merge of #80154 - GuillaumeGomez:str-to-symbol, r=jyn514bors-1/+4
Continue String to Symbol conversion in rustdoc (2) Follow-up of #80119. This is the last one (and I actually expected more conversions but seems like it was the last one remaining...). r? `@jyn514`
2020-12-18Remove `DefPath` from `Visibility` and calculate it on demandJoshua Nelson-15/+13
2020-12-18Calculate stability, const_stability, and deprecation on-demandJoshua Nelson-11/+2
Previously, they would always be calculated ahead of time, which bloated the size of `clean::Item`.
2020-12-18Continue String to Symbol conversion in rustdocGuillaume Gomez-1/+4
2020-12-18Auto merge of #80090 - jyn514:tcx-in-render, r=GuillaumeGomezbors-11/+15
Pass a `TyCtxt` through to `FormatRender` This is the next step after https://github.com/rust-lang/rust/pull/79957 for https://github.com/rust-lang/rust/issues/76382. Eventually I plan to use this to remove `stability`, `const_stability`, and `deprecation` from `Item`, but that needs more extensive changes (in particular, https://github.com/rust-lang/rust/pull/75355 or something like it). This has no actual changes to behavior, it's just moving types around. ccc https://github.com/rust-lang/rust/pull/80014#issuecomment-746810284
2020-12-18Auto merge of #80119 - GuillaumeGomez:str-to-symbol, r=jyn514bors-7/+12
Continue String to Symbol conversion in rustdoc Follow-up of https://github.com/rust-lang/rust/pull/80091. This PR is already big enough so I'll stop here before the next one. r? `@jyn514`
2020-12-17Continue String to Symbol conversion in rustdocGuillaume Gomez-7/+12
2020-12-17Make it compileJoshua Nelson-11/+14
2020-12-17[tmp] Pass `TyCtxt` through to the render backendJoshua Nelson-2/+3
First actually useful step in https://github.com/rust-lang/rust/issues/76382 This doesn't yet compile because there's no way to get a `Lrc<Session>` from a TyCtxt, only a `&Session`.
2020-12-17Rollup merge of #80047 - jyn514:more-symbols, r=GuillaumeGomezGuillaume Gomez-1/+1
Use more symbols in rustdoc Builds on https://github.com/rust-lang/rust/pull/80044 and should not be merged before. I want to test if this is actually faster before merging it, there was a lot of `to_string()` calls so I'm not sure it will actually help. That means I have to wait for 80044 to get merged before running perf. r? `@ghost`
2020-12-16Replace String with Symbol where possibleGuillaume Gomez-5/+9
2020-12-16Auto merge of #80041 - jyn514:shrink-item, r=GuillaumeGomezbors-4/+5
Get rid of `clean::Deprecation` This brings the size of `item.deprecation` from 56 to 16 bytes. Helps with #79103 and https://github.com/rust-lang/rust/issues/76382, in the same vein as https://github.com/rust-lang/rust/pull/79957. r? `@GuillaumeGomez`
2020-12-15Use `Symbol`s for crate namesJoshua Nelson-1/+1
2020-12-14Switch to Symbol for item.nameJoshua Nelson-1/+1
This decreases the size of `Item` from 680 to 616 bytes. It also does a lot less work since it no longer has to copy as much.
2020-12-14Get rid of `clean::Deprecation`Joshua Nelson-4/+5
This brings the size of `item.deprecation` from 56 to 16 bytes.
2020-12-12Fix the JSON backendJoshua Nelson-23/+25
This was simpler than expected.
2020-12-12Calculate span info on-demand instead of ahead of timeJoshua Nelson-4/+7
This should *vastly* reduce memory usage.
2020-12-12Pass Session into rendererJoshua Nelson-0/+3
2020-12-05Use true ID for def_id.Nixon Enraght-Moony-40/+45
2020-12-01Discard `const_stability`Nixon Enraght-Moony-0/+1
2020-12-01Address review comments.Nixon Enraght-Moony-49/+48
Go back to CRATE_DEF_INDEX Minor niceness improvements Don't output hidden items Remove striped items from fields Add $TEST_BASE_DIR Small catch
2020-12-01Add json backendJoseph Ryan-16/+1296
Respond to comments and start adding tests Fix re-exports and extern-crate Add expected output tests Add restricted paths Format Fix: associated methods missing in output Ignore stripped items Mark stripped items removing them creates dangling references Fix tests and update conversions Don't panic if JSON backend fails to create a file Fix attribute error in JSON testsuite Move rustdoc-json to rustdoc/ This way it doesn't have to build rustc twice. Eventually it should probably get its own suite, like rustdoc-js, but that can be fixed in a follow-up. Small cleanups Don't prettify json before printing This fully halves the size of the emitted JSON. Add comments [BREAKING CHANGE] rename version -> crate_version [BREAKING CHANGE] rename source -> span Use exhaustive matches Don't qualify imports for DefId Rename clean::{ItemEnum -> ItemKind}, clean::Item::{inner -> kind} Fix Visibility conversion clean::Visability was changed here: https://github.com/rust-lang/rust/pull/77820/files#diff-df9f90aae0b7769e1eb6ea6f1d73c1c3f649e1ac48a20e169662a8930eb427beL1467-R1509 More churn catchup Format
2020-11-15Make all rustdoc functions and structs crate-privateJoshua Nelson-1/+1
This gives warnings about dead code.