about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2022-04-18Make query parser more strict and improve display of errorsGuillaume Gomez-51/+64
2022-04-18* Greatly improve the rustdoc search parser source codeGuillaume Gomez-398/+497
* Move all functions outside parseQuery
2022-04-18Add query syntax for the parserGuillaume Gomez-12/+71
2022-04-18* If type filter is in quotes, throw an error.Guillaume Gomez-3/+11
* If there are generics, don't allow to have quotes.
2022-04-18Improve naming of "val" fieldGuillaume Gomez-32/+32
2022-04-18Update search engine and parser to error when quotes are used on queries ↵Guillaume Gomez-58/+104
with more than one element.
2022-04-18Greatly improve rustdoc searchGuillaume Gomez-394/+602
2022-04-17Stop using CRATE_DEF_INDEX.Camille GILLOT-3/+2
`CRATE_DEF_ID` and `CrateNum::as_def_id` are almost always what we want.
2022-04-17Remove extra space before a where clause in the documentationLoïc BRANSTETT-1/+2
2022-04-16Rollup merge of #96118 - GuillaumeGomez:cleanup-def-id-item-id, r=notriddleDylan DPC-39/+39
rustdoc: Rename `def_id` into `item_id` when the type is `ItemId` for readability As `@notriddle` mentioned in https://github.com/rust-lang/rust/pull/96091, the field name is inaccurate. This PR fixes it by renaming it accordingly to its real type. r? `@notriddle`
2022-04-16Rename `def_id` into `item_id` when the type is `ItemId` for readabilityGuillaume Gomez-39/+39
2022-04-15Rollup merge of #95194 - kckeiks:update-algo-in-find-use-placement, r=pnkfelixDylan DPC-2/+5
remove find_use_placement A more robust solution to finding where to place use suggestions was added in #94584. The algorithm uses the AST to find the span for the suggestion so we pass this span down to the HIR during lowering and use it instead of calling `find_use_placement` Fixes #94941
2022-04-14Error on `#[rustc_deprecated]`Jacob Pratt-2/+2
2022-04-13Rollup merge of #93217 - willcrichton:example-analyzer, r=GuillaumeGomezDylan DPC-52/+213
Improve Rustdoc UI for scraped examples with multiline arguments, fix overflow in line numbers This PR improves a few aspects of the scrape examples feature in Rustdoc. * Only function names and not the full call expression are highlighted. * For call-sites with multiline arguments, the minimized code viewer will scroll to the top of the call-site rather than the middle if the argument is larger than the viewer size, ensuring that the function name is visible. * This fixes an issue where the line numbers column had a visible x-scroll bar. r? `@GuillaumeGomez`
2022-04-12Add Rustdoc book link to scrape examples help. Remove remaining panicWill Crichton-3/+9
locations in scrape examples.
2022-04-12rustdoc: discr. required+provided assoc consts+tysLeón Orell Valerian Liehr-168/+262
2022-04-09rustdoc: Reduce allocations in a `html::markdown` functionRoc Yu-7/+5
2022-04-06Switch item-info div to span to generate valid HTMLGuillaume Gomez-3/+7
2022-04-06Rollup merge of #95684 - GuillaumeGomez:fix-item-info-overflow, r=notriddleDylan DPC-1/+1
rustdoc: Fix item info display overflow I came across this issue when reading local `Iterator` docs (reproduced in this screenshot): ![Screenshot from 2022-04-05 17-45-13](https://user-images.githubusercontent.com/3050060/161798150-769ee838-4768-4df8-9d34-b02eb8104eed.png) The problem comes from the fact that `span` isn't `display: block` by default. Since `item-info` was already present on `<div>` in other places, I moved the last one to `div` as well. r? `@notriddle`
2022-04-05Generate a <div> instead of a <span> for item-info elementsGuillaume Gomez-1/+1
2022-04-05Mark scalar layout unions so that backends that do not support partially ↵Oli Scherer-1/+1
initialized scalars can special case them.
2022-04-03Rollup merge of #95613 - GuillaumeGomez:fix-rustdoc-attr-display, r=notriddleDylan DPC-1/+6
Fix rustdoc attribute display Fixes #81482. r? `@notriddle`
2022-04-03Fix display of attributes in rustdocGuillaume Gomez-1/+6
2022-04-02Auto merge of #95568 - GuillaumeGomez:fix-invalid-dom-generation, r=notriddlebors-2/+2
Fix invalid DOM generation Fixes #64371. r? `@notriddle`
2022-04-01Fix invalid DOM generationGuillaume Gomez-2/+2
2022-04-01Rollup merge of #95475 - ↵Matthias Krüger-0/+1
Jules-Bertholet:rustdoc-hide-assoc-consts-from-trait-impls, r=jsha rustdoc: Only show associated consts from inherent impls in sidebar Resolves #95459
2022-03-31remove find_use_placementFausto-2/+5
A more robust solution to finding where to place use suggestions was added. The algorithm uses the AST to find the span for the suggestion so we pass this span down to the HIR during lowering and use it. Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
2022-03-30Remove unneeded `to_string` callGuillaume Gomez-1/+1
2022-03-30Only show associated consts from inherent impls in sidebarJules Bertholet-0/+1
2022-03-29Auto merge of #95096 - GuillaumeGomez:rm-header-fn-field, r=camelidbors-14/+15
Remove header field from clean::Function Fixes https://github.com/rust-lang/rust/issues/89673. This is another take on https://github.com/rust-lang/rust/issues/89673 (compared to https://github.com/rust-lang/rust/pull/91217) but very different on the approach: I moved the header call in one place but still require to have the `clean::Item` so I can use the `DefId` to get what is missing. cc `@jyn514` (you reviewed the original so maybe you want to take a look?) r? `@camelid`
2022-03-29Remove header field from clean::FunctionGuillaume Gomez-14/+15
2022-03-28Auto merge of #95024 - koehlma:rustdoc-private-items, ↵bors-3/+12
r=GuillaumeGomez,camelid,jsha rustdoc: add 🔒 to items with restricted visibility This change marks items with restricted visibility with 🔒 when building with `--document-private-items`: <img width="278" alt="Screen Shot 2022-03-20 at 23 50 24" src="https://user-images.githubusercontent.com/509209/159189513-9e4b09bb-6785-41a5-bfe2-df02f83f8641.png"> There also appears a “Restricted Visibility” tooltip when hovering over the emoji. --- The original PR for reference: This change makes private items slightly transparent (similar to `unstable` items in rustc): <img width="272" alt="Screen Shot 2022-03-16 at 22 17 43" src="https://user-images.githubusercontent.com/509209/158692627-a1f6f5ec-e043-4aa2-9352-8d2b15c31c08.png"> I found myself using `--document-private-items` a lot recently because I find the documentation of private internals quite helpful when working on a larger project. However, not being able to distinguish private from public items (see #87785) when looking at the documentation makes this somewhat cumbersome. This PR addresses the third suggestion of issue #87785 by marking private items typographically. It seems to me that the other suggestions are more involved but this is at least a first step. A private item is also made slightly transparent in the path displayed in the header of a page: <img width="467" alt="Screen Shot 2022-03-16 at 22 19 51" src="https://user-images.githubusercontent.com/509209/158692885-0bbd3417-3c0b-486f-b8ab-99c05c6fa7ca.png"> I am looking forward to feedback and suggestions.
2022-03-27Add scrape examples help pageWill Crichton-12/+86
2022-03-27Improve styling on scrape examples help buttonWill Crichton-12/+11
2022-03-27Fix markdown issue, remove hard-coded rust-lang.org urlWill Crichton-1/+3
2022-03-27Improve alignment of additional scraped examples, add scrape examples help pageWill Crichton-40/+106
2022-03-27Only highlight identifier in scraped examples, not argumentsWill Crichton-29/+4
2022-03-27Improve Rustdoc UI for scraped examples with multiline arguments, fixWill Crichton-15/+54
overflow in line numbers
2022-03-21fix: add a space only in front of 🔒Maximilian Köhl-2/+2
2022-03-21move the 🔒 after the nameMaximilian Köhl-1/+1
2022-03-19apply rustfmtMaximilian Köhl-2/+4
2022-03-19rustdoc: add 🔒 to indicate restricted visibilityMaximilian Köhl-3/+10
2022-03-19Remove animation on source sidebarGuillaume Gomez-7/+0
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-1/+1
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-14Auto merge of #94139 - est31:let_else_rustdoc, r=notriddlebors-24/+10
librustdoc: adopt let else in more places Continuation of #89933, #91018, #91481, #93046, #93590, #94011. I have extended my clippy lint to also recognize tuple passing and match statements. The diff caused by fixing it is way above 1 thousand lines. Thus, I split it up into multiple pull requests to make reviewing easier. This PR handles librustdoc.
2022-03-13Auto merge of #94320 - GuillaumeGomez:sidebar-display, r=jshabors-3/+3
Fix sidebar elements display The bug can be seen more easily when the javascript is disabled: ![Screenshot from 2022-02-24 12-18-28](https://user-images.githubusercontent.com/3050060/155514578-cbefd3dd-f006-47e9-bc76-7c26d7e823e8.png) r? `@jsha`
2022-03-12Auto merge of #94733 - nnethercote:fix-AdtDef-interning, r=fee1-deadbors-1/+1
Improve `AdtDef` interning. This commit makes `AdtDef` use `Interned`. Much of the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`. r? `@fee1-dead`
2022-03-11Collapse Blanket Implementations and Auto-trait implementations by defaultGuillaume Gomez-5/+11
2022-03-11Auto merge of #94304 - notriddle:notriddle/buffer-args, r=CraftSpiderbors-27/+19
rustdoc: write directly to buffer in `inner_full_print` This change avoids several temporary allocations for every argument.
2022-03-11Improve `AdtDef` interning.Nicholas Nethercote-1/+1
This commit makes `AdtDef` use `Interned`. Much the commit is tedious changes to introduce getter functions. The interesting changes are in `compiler/rustc_middle/src/ty/adt.rs`.