summary refs log tree commit diff
path: root/src/librustdoc/json
AgeCommit message (Collapse)AuthorLines
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.
2020-07-30Update driver to add json backendJoseph Ryan-0/+47