about summary refs log tree commit diff
path: root/src/librustdoc/html/render
AgeCommit message (Collapse)AuthorLines
2021-10-06Change serialized format to use DefPathHash instead of custom StringWill Crichton-22/+19
Move test to rustdoc-ui Fix test writing to wrong directory Formatting Fix test Add FIXME Remove raw multiline strings
2021-10-06Incorporate jyn's feedbackWill Crichton-31/+51
* Move call location logic from function constructor to rendering * Fix issue with macro spans in scraping examples * Clean up example loading logic Documentation / newtype for DecorationInfo Fix line number display Serialize edition of call site, other small cleanup
2021-10-06Add styles for non-white themesWill Crichton-14/+14
Tweak colors Tabs New link heading style
2021-10-06Reduce blur size, fix example width bug, add better error handling for I/O ↵Will Crichton-25/+59
issues Remove repository url Fix formatting Fix file_span in print_src Formatting
2021-10-06Move highlighting logic from JS to RustWill Crichton-12/+30
Continue migrating JS functionality Cleanup Fix compile error Clean up the diff Set toggle font to sans-serif
2021-10-06Sort examples by sizeWill Crichton-18/+57
Improve styling Start to clean up code, add comments
2021-10-06Generate example source files with corresponding linksWill Crichton-41/+51
Add display name Fix remaining merge conflicts Only embed code for items containing examples
2021-10-06Factor scraping and rendering into separate calls to rustdocWill Crichton-2/+9
Simplify toggle UI logic, add workspace root for URLs
2021-10-06Fix check issueWill Crichton-1/+1
Clean up tidy checks
2021-10-06Add updated support for example-analyzerWill Crichton-1/+103
Move rendering of examples into Finalize design Cleanup, rename found -> scraped Softer yellow Clean up dead code Document scrape_examples More simplification and documentation Remove extra css Test
2021-10-06Rollup merge of #89506 - yaymukund:docblock-headings, r=GuillaumeGomezManish Goregaokar-52/+82
librustdoc: Use correct heading levels. Closes #89309 This fixes the `<h#>` header tags throughout the docs to reflect a semantic hierarchy. - I ran a script to manually check that we don't have any files with multiple `<h1>` tags. - Also checked that we never incorrectly nest e.g. a `<h2>` under an `<h3>`. - I also spot-checked a bunch of pages (`trait.Read`, `enum.Ordering`, `primitive.isize`, `trait.Iterator`).
2021-10-05Allow adding a set of cfg's to hide from being implicitly doc(cfg)'dWim Looman-1/+1
By adding #![doc(cfg_hide(foobar))] to the crate attributes the cfg #[cfg(foobar)] (and _only_ that _exact_ cfg) will not be implicitly treated as a doc(cfg) to render a message in the documentation.
2021-10-05Make cfg implicitly imply doc(cfg)Wim Looman-1/+1
This is only active when the `doc_cfg` feature is active. The implicit cfg can be overridden via #[doc(cfg(...))], so e.g. to hide a #[cfg] you can use something like: ```rust #[cfg(unix)] #[doc(cfg(all()))] pub struct Unix; ``` (since `all()` is always true, it is never shown in the docs)
2021-10-04heading_level: u32 -> heading_offset: HeadingOffsetMukund Lakshman-38/+48
2021-10-04No need to default offset since we always override it.Mukund Lakshman-33/+29
2021-10-04Change `Markdown(...)` to `Markdown { ... }`Mukund Lakshman-19/+19
2021-10-04Fix heading for methods on trait impls.Mukund Lakshman-1/+1
2021-10-04librustdoc: Use correct heading levels.Mukund Lakshman-19/+43
- Avoid multiple <h1>s on a page. - The <h#> tags should follow a semantic hierarchy. - Cap at h6 (no h7)
2021-10-03Move from grid layout to table based layout because of browser limits that ↵Stefan Schindler-11/+8
overlay row entries after a UA specific amount of rows
2021-10-02Replace all uses of `path.res.def_id()` with `path.def_id()`Noah Lev-2/+2
2021-10-01Auto merge of #89395 - ↵bors-6/+3
In-line:remove_visible_path_from_allowed_deprecated_lint, r=jyn514 Remove visible path calculation from allowed deprecation lint
2021-09-30Remove temporary `GetDefId` impl for `Path`Noah Lev-56/+40
2021-09-30Use `Path` instead of `Type` in `PolyTrait`Noah Lev-18/+18
The change to `impl Clean<Path> for hir::TraitRef<'_>` was necessary to fix a test failure for `src/test/rustdoc/trait-alias-mention.rs`. Here's why: The old code path was through `impl Clean<Type> for hir::TraitRef<'_>`, which called `resolve_type`, which in turn called `register_res`. Now, because `PolyTrait` uses a `Path` instead of a `Type`, the impl of `Clean<Path>` was being run, which did not call `register_res`, causing the trait alias to not be recorded in the `external_paths` cache.
2021-09-30Make `Impl.trait_` a `Path`, not a `Type`Noah Lev-2/+2
It should only ever be a `ResolvedPath`, so this (a) enforces that, and (b) reduces the size of `Impl`. I had to update a test because the order of the rendered auto trait impl bounds changed. I think the order changed because rustdoc sorts auto trait bounds using their `Debug` output.
2021-09-30Remove visible path calculation from allowed deprecation lintAlik Aslanyan-6/+3
2021-09-29Remove Never variant from clean::Type enumGuillaume Gomez-1/+0
2021-09-25Rollup merge of #88895 - camelid:cleanup-pt2, r=jyn514Manish Goregaokar-9/+9
rustdoc: Cleanup `clean` part 2 Split out from #88379. This contains the following commits from that PR: - Remove `Type::ResolvedPath.is_generic` - Rename `is_generic()` to `is_assoc_ty()` r? `@jyn514`
2021-09-21rustdoc: Emphasize "completely unstable"Noah Lev-1/+1
2021-09-21rustdoc: Note that type layout may differ between compilationsNoah Lev-1/+1
2021-09-17Add rustdoc version into the help popupGuillaume Gomez-4/+12
2021-09-16Auto merge of #88219 - jyn514:parallel-io, r=GuillaumeGomezbors-38/+46
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-13Add support for primitives in "jump to definition" featureGuillaume Gomez-7/+11
2021-09-12Rename `is_generic()` to `is_assoc_ty()`Noah Lev-2/+2
The new name is more accurate than the previous one.
2021-09-12Remove `Type::ResolvedPath.is_generic`Noah Lev-9/+9
It can be computed on-demand.
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-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-1/+2
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-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-1/+2
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-02Rename walk_crate.Camille GILLOT-1/+1