about summary refs log tree commit diff
path: root/src/librustdoc/html/render
AgeCommit message (Collapse)AuthorLines
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-23Cleanup `render_stability_since_raw` to remove code duplicationLeSeulArtichaut-26/+17
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-7/+7
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-21Fix rustc::internal lints on rustdocJoshua Nelson-2/+1
2021-01-21Rollup merge of #81184 - jyn514:combine-after, r=CraftSpiderYuki Okushi-12/+15
Remove unnecessary `after_run` function It's called at the same time and in the same place as `after_krate`, so they can be combined.
2021-01-20Remove StructType entirely and replace it with CtorKindRune Tynan-6/+7
2021-01-20Move StructType to clean, remove it from Unions, make JSON output whether ↵Rune Tynan-7/+6
something is a union
2021-01-19Remove unnecessary `after_run` functionJoshua Nelson-12/+15
It's called at the same time and in the same place as `after_krate`, so they can be combined.
2021-01-18Remove inline script tagsGuillaume Gomez-5/+2
2021-01-15Rename VariantKind -> VariantJoshua Nelson-6/+6
There's no `Variant`, so it seems silly to have `Kind`.
2021-01-15Remove useless `clean::Variant` structJoshua Nelson-13/+10
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-8/+3
2021-01-08Combine several `push_str` callsJ. Ryan Stinnett-4/+3
2021-01-08Use target in `Deref` method section IDsJ. Ryan Stinnett-40/+51
There can now be multiple `Deref` method sections, so this adds the target type to the section ID to ensure they are unique.
2021-01-08Recursively document methods via `Deref` traitsJ. Ryan Stinnett-3/+33
2021-01-04Extract `sidebar_deref_methods` functionJ. Ryan Stinnett-52/+52
2021-01-04Auto merge of #80661 - jyn514:duplicate-types, r=GuillaumeGomezbors-0/+3
Cleanup rustdoc handling of associated types This is best reviewed a commit at a time. No particular reason for these changes, they just stood out as I was reviewing https://github.com/rust-lang/rust/pull/80653 and thinking about https://github.com/rust-lang/rust/issues/80379. The new test case worked before, it just wasn't tested. r? `@GuillaumeGomez`
2021-01-03Simplify rustdoc handling of type aliases for associated typesJoshua Nelson-0/+3
The logic was very hard to follow before.
2021-01-02Improve code for DocFragment reworkGuillaume Gomez-6/+2
2021-01-02End of rework of Attributes structGuillaume Gomez-10/+9
2021-01-01clippy fixes for librustdocMatthias Krüger-7/+9
fixes clippy warnings of type: match_like_matches_macro or_fun_call op_ref needless_return let_and_return single_char_add_str useless_format unnecessary_sort_by match_ref_pats redundant_field_names
2020-12-31Rollup merge of #80368 - camelid:rustdoc-succinct-vis, r=jyn514Dylan DPC-18/+23
rustdoc: Render visibilities succinctly Fixes #79139. r? `@jyn514`
2020-12-30Rollup merge of #80495 - jyn514:rename-empty, r=petrochenkovMara Bos-3/+3
Rename kw::Invalid -> kw::Empty See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471 for context. r? `@petrochenkov`
2020-12-30Rename kw::Invalid -> kw::EmptyJoshua Nelson-3/+3
See https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Is.20there.20a.20symbol.20for.20the.20empty.20string.3F/near/220054471 for context.
2020-12-30Rollup merge of #80509 - matthiaskrgr:ptr_arg, r=varkorYuki Okushi-1/+1
where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)
2020-12-30where possible, pass slices instead of &Vec or &String (clippy::ptr_arg)Matthias Krüger-1/+1
2020-12-29don't clone copy typesMatthias Krüger-2/+2
2020-12-29Auto merge of #80014 - jyn514:box-item-kind, r=nnethercotebors-27/+28
[rustdoc] Box ItemKind to reduce the size of `Item` This brings the size of `Item` from ``` [src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 536 ``` to ``` [src/librustdoc/lib.rs:103] std::mem::size_of::<Item>() = 136 ``` This is an alternative to https://github.com/rust-lang/rust/pull/79967; I don't think it makes sense to make both changes. Helps with #79103.
2020-12-25Fix bugs; fix and add testsCamelid-20/+18
2020-12-25rustdoc: Render visibilities succinctlyCamelid-18/+25
2020-12-24rustdoc: Highlight edition-specific keywords correctly in code blocks, ↵ThePuzzlemaker-0/+1
accounting for code block edition modifiers This is a squash of these commits: - Highlight edition-specific keywords correctly in code blocks, accounting for code block edition modifiers - Fix unit tests - Revert changes to rustc_span::symbol to prepare for merge of #80272 - Use new Symbol::is_reserved API from #80272 - Remove unused import added by accident when merging
2020-12-23Box ItemKind to reduce the size of `Item`Joshua Nelson-27/+28
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-30/+38
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-36/+54
[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-2/+2
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-31/+43
2020-12-18Calculate stability, const_stability, and deprecation on-demandJoshua Nelson-36/+54
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-2/+2
2020-12-18Auto merge of #80090 - jyn514:tcx-in-render, r=GuillaumeGomezbors-48/+77
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-13/+13
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-13/+13
2020-12-17Make it compileJoshua Nelson-47/+75
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-13/+17
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-17Auto merge of #80091 - GuillaumeGomez:str-to-symbol, r=jyn514bors-1/+1
Replace String with Symbol where possible The same as #80047 but on different types. Might be interesting to run some perf comparison. r? `@jyn514`
2020-12-16Replace String with Symbol where possibleGuillaume Gomez-1/+1
2020-12-16Allow `since="TBD"` for rustc_deprecatedbstrie-1/+5
2020-12-16Auto merge of #80041 - jyn514:shrink-item, r=GuillaumeGomezbors-6/+13
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-13/+17