about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2021-09-21rustdoc: Note that type layout may differ between compilationsNoah Lev-1/+1
2021-09-17Add rustdoc version into the help popupGuillaume Gomez-13/+39
2021-09-16Auto merge of #88219 - jyn514:parallel-io, r=GuillaumeGomezbors-39/+47
rustdoc: reduce number of copies when using parallel IO This is Windows-only for now; I was getting really bad slowdowns from this on linux for some reason. Helps with https://github.com/rust-lang/rust/issues/82741. Follow-up to https://github.com/rust-lang/rust/pull/60971.
2021-09-13Rollup merge of #88885 - GuillaumeGomez:fix-jump-def-background, r=camelidGuillaume Gomez-1/+1
Fix jump def background Fixes #88870. I somehow badly wrote the color in #88111. r? ``@camelid``
2021-09-13Add support for primitives in "jump to definition" featureGuillaume Gomez-7/+19
2021-09-12Rename `is_generic()` to `is_assoc_ty()`Noah Lev-4/+4
The new name is more accurate than the previous one.
2021-09-12Remove `Type::ResolvedPath.is_generic`Noah Lev-33/+22
It can be computed on-demand.
2021-09-12Fix invalid background for jump-to-def links in source code pagesGuillaume Gomez-1/+1
2021-09-12Rollup merge of #88810 - camelid:cleanup-pt1, r=jyn514Manish Goregaokar-22/+24
rustdoc: Cleanup `clean` part 1 Split out from #88379. These commits are completely independent of each other, and each is a fairly small change (the last few are new commits; they are not from #88379): - Remove unnecessary `Cache.*_did` fields - rustdoc: Get symbol for `TyParam` directly - Create a valid `Res` in `external_path()` - Remove unused `hir_id` parameter from `resolve_type` - Fix redundant arguments in `external_path()` - Remove unnecessary `is_trait` argument - rustdoc: Cleanup a pattern match in `external_generic_args()` r? ``@jyn514``
2021-09-12Fix broken handling of primitive itemsJoshua Nelson-1/+7
- Fix broken handling of primitive associated items - Remove fragment hack Fixes 83083 - more logging - Update CrateNum hacks The CrateNum has no relation to where in the dependency tree the crate is, only when it's loaded. Explicitly special-case core instead of assuming it will be the first DefId. - Update and add tests - Cache calculation of primitive locations This could possibly be avoided by passing a Cache into collect_intra_doc_links; but that's a much larger change, and doesn't seem valuable other than for this.
2021-09-12downgrade some loggingJoshua Nelson-1/+1
2021-09-11Only take `tcx` when it's all that's neededNoah Lev-7/+12
2021-09-11Rollup merge of #88668 - hvdijk:x32, r=joshtriplettJubilee-1/+1
Change more x64 size checks to not apply to x32. Commit 95e096d6 changed a bunch of size checks already, but more have been added, so this fixes the new ones the same way: the various size checks that are conditional on target_arch = "x86_64" were not intended to apply to x86_64-unknown-linux-gnux32, so add target_pointer_width = "64" to the conditions.
2021-09-10Rollup merge of #88776 - dns2utf8:rustdoc_workaround_1000_elements_grid_bug, ↵Manish Goregaokar-0/+12
r=GuillaumeGomez Workaround blink/chromium grid layout limitation of 1000 rows I made this in case we don't come up with a better solution in time. See https://github.com/rust-lang/rust/issues/88545 for more details. A rendered version of the standard library is hosted here: https://data.estada.ch/rustdoc-nightly_497ee321af_2021-09-09/core/arch/arm/index.html r? `@GuillaumeGomez` `@jsha`
2021-09-10Rollup merge of #88742 - GuillaumeGomez:fix-table-in-docblocks, r=nbdd0121Manish Goregaokar-3/+48
Fix table in docblocks "Overwrite" of #88702. Instead of adding a z-index to the sidebar (which only hides the issue, doesn't fix it), I wrap `<table>` elements inside a `<div>` and limit all chidren of `.docblock` elements' width to prevent having the scrollbar on the whole doc block. ![Screenshot from 2021-09-08 15-11-24](https://user-images.githubusercontent.com/3050060/132515740-71796515-e74f-429f-ba98-2596bdbf781c.png) Thanks `@nbdd0121` for `overflow-x: auto;`. ;) r? `@notriddle`
2021-09-10Rollup merge of #88639 - Emilgardis:fix-issue-88600, r=GuillaumeGomezManish Goregaokar-24/+27
rustdoc: Fix ICE with `doc(hidden)` on tuple variant fields Fixes #88600. ```rust pub struct H; pub struct S; pub enum FooEnum { HiddenTupleItem(#[doc(hidden)] H), MultipleHidden(#[doc(hidden)] H, #[doc(hidden)] H), MixedHiddenFirst(#[doc(hidden)] H, S), MixedHiddenLast(S, #[doc(hidden)] H), HiddenStruct { #[doc(hidden)] h: H, s: S, }, } ``` Generates ![image](https://user-images.githubusercontent.com/1502855/132259152-382f9517-c2a0-41d8-acd0-64e5993931fc.png)
2021-09-10Rollup merge of #88632 - camelid:md-opts, r=CraftSpiderManish Goregaokar-9/+14
Fix issues with Markdown summary options - Use `summary_opts()` for Markdown summaries - Enable all main body Markdown options for summaries
2021-09-09Remove unnecessary `Cache.*_did` fieldsNoah Lev-22/+19
They can be obtained by accessing the `TyCtxt` where they are needed.
2021-09-09Ignore automatically derived impls of `Clone` and `Debug` in dead code analysisFabian Wolff-2/+0
2021-09-09Workaround blink/chromium grid layout limitation of 1000 rowsStefan Schindler-0/+12
See https://github.com/rust-lang/rust/issues/88545 for more details
2021-09-08Rollup merge of #86263 - fee1-dead:rustdoc-layout-variants, r=camelidJack Huey-11/+46
Rustdoc: Report Layout of enum variants Followup of #83501, Fixes #86253. cc `@camelid` `@rustbot` label A-rustdoc
2021-09-08Wrap <table> elements into <div> to prevent breaking layout and widthGuillaume Gomez-3/+48
2021-09-08Auto merge of #87489 - bdalrhm:rustdoc-line-num, r=CraftSpiderbors-1/+29
`rustdoc`: compute correct line number for indented rust code blocks. This PR fixes a bug in `rustdoc` where it computes the wrong line number for indented rust code blocks (and subsequent blocks) it finds in markdown strings. To fix this issue, we decrement the line number if we find characters between the code block and the preceding line ending. I noticed this issue as I was trying to use `rustdoc` to extract examples from The Rust Reference and run them through the [Rust Model Checker](https://github.com/model-checking/rmc).
2021-09-06fix ICE on hidden tuple variant fieldsEmil Gardström-24/+27
this also renders them as `_`, which rustdoc previously did not.
2021-09-06Correctly handle niche of enumDeadbeef-4/+8
2021-09-05Auto merge of #88435 - cjgillot:no-walk-crate, r=Aaron1011bors-1/+1
Avoid invoking the hir_crate query to traverse the HIR Walking the HIR tree is done using the `hir_crate` query. However, this is unnecessary, since `hir_owner(CRATE_DEF_ID)` provides the same information. Since depending on `hir_crate` forces dependents to always be executed, this leads to unnecessary work. By splitting HIR and attributes visits, we can avoid an edge to `hir_crate` when trying to visit the HIR tree.
2021-09-05Change more x64 size checks to not apply to x32.Harald van Dijk-1/+1
Commit 95e096d6 changed a bunch of size checks already, but more have been added, so this fixes the new ones the same way: the various size checks that are conditional on target_arch = "x86_64" were not intended to apply to x86_64-unknown-linux-gnux32, so add target_pointer_width = "64" to the conditions.
2021-09-05Auto merge of #88604 - camelid:rustdoc-lifetime-bounds, r=GuillaumeGomezbors-4/+18
rustdoc: Clean up handling of lifetime bounds 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. Also, higher-ranked lifetimes cannot currently have bounds, so I simplified the code to reflect that. r? `@GuillaumeGomez`
2021-09-03Enable all main body Markdown options for summariesNoah Lev-2/+6
This fixes odd renderings when these features are used in the first paragraph of documentation for an item. This is an extension of #87270.
2021-09-03Use `summary_opts()` for Markdown summariesNoah Lev-8/+9
It was accidentally changed to use `opts()` in #86451. I also renamed `opts()` to `main_body_opts()` to make this kind of accidental change less likely.
2021-09-02rustdoc: Clean up handling of lifetime boundsNoah Lev-4/+18
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-09-02Rename walk_crate.Camille GILLOT-1/+1
2021-09-02Stop using walk_crate.Camille GILLOT-1/+1
2021-09-02Auto merge of #88516 - matthiaskrgr:clippy_perf_end_august, ↵bors-4/+3
r=jyn514,GuillaumeGomez some low hanging clippy::perf fixes
2021-09-01Auto merge of #88490 - GuillaumeGomez:associated-types-implementors-display, ↵bors-38/+81
r=camelid,Manishearth Display associated types of implementors Fixes #86631. Contrary to before, it doesn't display methods. I also had to "resurrect" the `auto-hide-trait-implementations` setting. :3 Only question at this point: should I move the `render_impl` boolean arguments into one struct? We're starting to have quite a lot of them... cc `@cynecx` r? `@camelid`
2021-09-01Remove implementors settingGuillaume Gomez-6/+0
2021-09-01Clean render_impl argumentsGuillaume Gomez-46/+67
2021-09-01Rollup merge of #88410 - camelid:fix-assoc-bold, r=GuillaumeGomezMara Bos-1/+1
Remove bolding on associated constants Associated types don't get bolded, so it looks off to have one kind bolded and one not.
2021-08-31some low hanging clippy::perf fixesMatthias Krüger-4/+3
2021-08-31Remove bolding on associated constantsNoah Lev-1/+1
Associated types don't get bolded, so it looks off to have one kind bolded and one not.
2021-08-31Rollup merge of #88391 - GuillaumeGomez:fix-json-enum-variant, ↵Mara Bos-17/+24
r=camelid,notriddle Fix json tuple struct enum variant Fixes #87887. cc `@dsherret` `@camelid` r? `@notriddle`
2021-08-31Apply suggestionsDeadbeef-3/+2
2021-08-31Report variant size without the discriminantDeadbeef-7/+13
2021-08-31Apply suggestionsDeadbeef-26/+18
2021-08-31Report Layout of enum variantsDeadbeef-1/+35
Followup of #83501, Fixes #86253.
2021-08-30Put back "auto-collapse-implementors" settingGuillaume Gomez-0/+6
2021-08-30Put back display of associated items (types and consts)Guillaume Gomez-11/+33
2021-08-29Rollup merge of #88419 - GuillaumeGomez:code-blocks-colors, r=camelid,notriddleGuillaume Gomez-1/+1
Fix code blocks color in Ayu theme Fixes #88415. cc `@camelid` r? `@notriddle`
2021-08-29Rollup merge of #88173 - camelid:refactor-markdown-length-limit, ↵Guillaume Gomez-43/+270
r=GuillaumeGomez Refactor Markdown length-limited summary implementation This PR is a new approach to #79749. This PR refactors the implementation of `markdown_summary_with_limit()`, separating the logic of determining when the limit has been reached from the actual rendering process. The main advantage of the new approach is that it guarantees that all HTML tags are closed, whereas the previous implementation could generate tags that were never closed. It also ensures that no empty tags are generated (e.g., `<em></em>`). The new implementation consists of a general-purpose struct `HtmlWithLimit` that manages the length-limiting logic and a function `markdown_summary_with_limit()` that renders Markdown to HTML using the struct. r? `@GuillaumeGomez`
2021-08-29Use the correct type for Enum variant tuplesGuillaume Gomez-17/+24