about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
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`.
2022-03-10Rollup merge of #93950 - T-O-R-U-S:use-modern-formatting-for-format!-macros, ↵Dylan DPC-1/+1
r=Mark-Simulacrum Use modern formatting for format! macros This updates the standard library's documentation to use the new format_args syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored). `eprintln!("{}", e)` becomes `eprintln!("{e}")`, but `eprintln!("{}", e.kind())` remains untouched.
2022-03-10Rollup merge of #94740 - GuillaumeGomez:unify-impl-blocks, r=notriddleMatthias Krüger-7/+12
Unify impl blocks by wrapping them into a div The blanket and "auto traits" sections are wrapped into a `div` with an ID. This PR fixes this incoherence by wrapping each impl section (the "deref impl" and the "inherent impl" sections were missing it). It'll also make some tests simpler to write. r? `````@notriddle`````
2022-03-10Use implicit capture syntax in format_argsT-O-R-U-S-1/+1
This updates the standard library's documentation to use the new syntax. The documentation is worthwhile to update as it should be more idiomatic (particularly for features like this, which are nice for users to get acquainted with). The general codebase is likely more hassle than benefit to update: it'll hurt git blame, and generally updates can be done by folks updating the code if (and when) that makes things more readable with the new format. A few places in the compiler and library code are updated (mostly just due to already having been done when this commit was first authored).
2022-03-08Unify inherent impl blocks by wrapping them into a divGuillaume Gomez-7/+12
2022-03-07Auto merge of #94706 - matthiaskrgr:rollup-l5erynr, r=matthiaskrgrbors-8/+5
Rollup of 4 pull requests Successful merges: - #93350 (libunwind: readd link attrs to _Unwind_Backtrace) - #93827 (Stabilize const_fn_fn_ptr_basics, const_fn_trait_bound, and const_impl_trait) - #94696 (Remove whitespaces and use CSS to align line numbers to the right instead) - #94700 (rustdoc: Update minifier version) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-07Remove unneeded whitespace generation and use CSS instead instead to align ↵Guillaume Gomez-8/+5
line numbers to the right
2022-03-07Clarify `Layout` interning.Nicholas Nethercote-5/+5
`Layout` is another type that is sometimes interned, sometimes not, and we always use references to refer to it so we can't take any advantage of the uniqueness properties for hashing or equality checks. This commit renames `Layout` as `LayoutS`, and then introduces a new `Layout` that is a newtype around an `Interned<LayoutS>`. It also interns more layouts than before. Previously layouts within layouts (via the `variants` field) were never interned, but now they are. Hence the lifetime on the new `Layout` type. Unlike other interned types, these ones are in `rustc_target` instead of `rustc_middle`. This reflects the existing structure of the code, which does layout-specific stuff in `rustc_target` while `TyAndLayout` is generic over the `Ty`, allowing the type-specific stuff to occur in `rustc_middle`. The commit also adds a `HashStable` impl for `Interned`, which was needed. It hashes the contents, unlike the `Hash` impl which hashes the pointer.
2022-03-06Rollup merge of #93412 - fee1-dead:improve-rustdoc-const-bounds, ↵Matthias Krüger-72/+85
r=GuillaumeGomez Improve rustdoc const bounds - Rustdoc no longer displays `~const` in trait bounds, because it currently means nothing for stable users, and because we still haven't decided on the final syntax yet. - Rustdoc will hide trait bounds where the trait is `Drop` AND it is `~const`, i.e. `~const Drop` bounds because it has no effect on stable users as well. - Because of additional logic that hides the whole `where` statement where it consists of `~const Drop` bounds (so it doesn't display `struct Foo<T>() where ;` like that), bounds that have no trait e.g. `where [T; N+1]: ;` are also hidden. Cherry-picked from #92433.
2022-03-05Rollup merge of #94642 - GuillaumeGomez:source-code-scroll, r=UrgauRalf Jung-9/+7
Fix source code pages scroll To reproduce the bug, go to https://doc.rust-lang.org/nightly/nightly-rustc/src/rustc_ast/ast.rs.html#537-541 and click on the `Path` link. The page won't scroll to the content. r? `@Urgau`
2022-03-05Scroll when the anchor change and is linking outside of the displayed contentGuillaume Gomez-9/+7
2022-03-04librustdoc: adopt let else in more placesest31-24/+10
2022-03-04Auto merge of #94588 - Dylan-DPC:rollup-7pxd0i3, r=Dylan-DPCbors-1/+1
Rollup of 10 pull requests Successful merges: - #88805 (Clarification of default socket flags) - #93418 (rustdoc & doc: no `shortcut` for `rel="icon"`) - #93913 (Remove the everybody loops pass) - #93965 (Make regular stdio lock() return 'static handles) - #94339 (ARM: Only allow using d16-d31 with asm! when supported by the target) - #94404 (Make Ord and PartialOrd opt-out in `newtype_index`) - #94466 (bootstrap: correct reading of flags for llvm) - #94572 (Use `HandleOrNull` and `HandleOrInvalid` in the Windows FFI bindings.) - #94575 (CTFE SwitchInt: update comment) - #94582 (Fix a bug in `x.py fmt` that prevents some files being formatted.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-04Rollup merge of #93418 - ojeda:no-shortcut, r=camelidDylan DPC-1/+1
rustdoc & doc: no `shortcut` for `rel="icon"` According to https://html.spec.whatwg.org/multipage/links.html#rel-icon: > For historical reasons, the `icon` keyword may be preceded by the keyword "`shortcut`". And to https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types: > **Warning:** The `shortcut` link type is often seen before `icon`, but this link type is non-conforming, ignored and **web authors must not use it anymore.** While it was removed from the Rust logo case a while ago in commit 085679c ("Use theme-adaptive SVG favicon from other Rust sites"), it is still there for the custom logo case. Also updated a few other instances. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-03-03make generic projection types print correctlyMichael Goulet-5/+11
2022-02-27make GATs print properly in traitsMichael Goulet-18/+39
2022-02-27move method out of nestingMichael Goulet-89/+90
2022-02-27Rollup merge of #94417 - GuillaumeGomez:fix-duplicated-impl-links, r=notriddleMatthias Krüger-7/+10
Fix duplicated impl links Fixes #78701. The problem is that the blanket impl has the same ID as the other impl, except that we don't derive IDs when we generate the sidebar. We now do. r? ``@notriddle``
2022-02-27Correctly generate links in the sidebar for implsGuillaume Gomez-7/+10
2022-02-24Fix bad handling of the source code viewer sidebar style to prevent the ↵Guillaume Gomez-3/+3
appearance of the logo
2022-02-23rustdoc: write directly to buffer in `inner_full_print`Michael Howell-27/+19
This change avoids several temporary allocations for every argument.
2022-02-22Prevent generation of infinite redirectionsGuillaume Gomez-26/+34
2022-02-22Address review commentsDeadbeef-10/+10
2022-02-22Bless rustdoc testDeadbeef-84/+82
2022-02-22Do not display hidden `~const Drop` boundsDeadbeef-5/+19
2022-02-22Do not display ~const in rustdocDeadbeef-1/+2
2022-02-20Rollup merge of #94002 - GuillaumeGomez:duplicated-sidebar-macro, r=notriddleMatthias Krüger-6/+11
rustdoc: Avoid duplicating macros in sidebar Fixes #93912. cc ``````@jsha`````` (for the GUI test) r? ``````@camelid``````
2022-02-17Rollup merge of #94011 - est31:let_else, r=lcnrMatthias Krüger-6/+2
Even more let_else adoptions Continuation of #89933, #91018, #91481, #93046, #93590.
2022-02-17Rollup merge of #93780 - GuillaumeGomez:links-in-sidebar, r=jshaMatthias Krüger-127/+109
Generate list instead of div items in sidebar Fixes #92986. Surprisingly, we didn't have much CSS for this... [Demo](https://rustdoc.crud.net/imperio/links-in-sidebar/std/index.html). r? `@jsha`