about summary refs log tree commit diff
path: root/src/test/rustdoc
AgeCommit message (Collapse)AuthorLines
2022-05-07Rollup merge of #96636 - GuillaumeGomez:fix-jump-to-def-regression, r=notriddleGuillaume Gomez-0/+18
Fix jump to def regression https://github.com/rust-lang/rust/pull/93803 introduced a regression in the "jump to def" feature. This fixes it. Nice side-effect: it adds a new regression test. :) I also used this opportunity to add documentation about this unstable feature in the rustdoc book. cc ``@cjgillot`` r? ``@notriddle``
2022-05-06Add regression test for jump-to-defGuillaume Gomez-0/+18
2022-05-05Fix test case checking for where the JS goesMichael Howell-1/+1
2022-04-29Rollup merge of #96536 - rust-lang:notriddle/deref-slice-core, r=GuillaumeGomezDylan DPC-0/+22
rustdoc: fix missing method list for primitive deref target This change makes it so that local impls count when listing primitives that need retained. Fixes #95325
2022-04-29rustdoc: show implementations on `#[fundamental]` wrappersMichael Howell-0/+16
Fixes #92940
2022-04-28rustdoc: fix missing method list for primitive deref targetMichael Howell-0/+22
This change makes it so that local impls count when listing primitives that need retained.
2022-04-27Rollup merge of #96410 - notriddle:notriddle/issue-95873, r=GuillaumeGomezDylan DPC-0/+2
rustdoc: do not write `{{root}}` in `pub use ::foo` docs Fixes #95873
2022-04-26Update src/test/rustdoc/issue-95873.rsMichael Howell-1/+1
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2022-04-25rustdoc: do not write `{{root}}` in `pub use ::foo` docsMichael Howell-0/+2
2022-04-25Fix issue 96381Michael Goulet-0/+16
2022-04-20Auto merge of #96135 - petrochenkov:doclink6, r=GuillaumeGomezbors-0/+26
rustdoc: Optimize and refactor doc link resolution One more subset of https://github.com/rust-lang/rust/pull/94857 that should bring perf improvements rather than regressions + a couple more optimizations on top of it. It's better to read individual commits and their descriptions to understand the changes. The `may_have_doc_links` optimization is not *very* useful here, but it's much more important for https://github.com/rust-lang/rust/pull/94857. Closes https://github.com/rust-lang/rust/issues/96079
2022-04-19Rollup merge of #95813 - Urgau:rustdoc-where-clause-space, r=GuillaumeGomezDylan DPC-0/+17
Remove extra space before a where clause Remove extra space before where clause in the generated documentation. The fix is to move the space before the break-line so that it doesn't appear visually but is still here. Removing it completely would create things like this `impl<D> Delta<D>where D: MyTrait` (missing a space before the where) which I don't think we want. Added two regression test, first one test that the `<br>` is after the space and the second check that the `<br>` is before the spaces. Before: ![image](https://user-images.githubusercontent.com/3616612/162475212-d4bb6727-ed66-4a55-a4a2-4f55189bf8bd.png) After: ![image](https://user-images.githubusercontent.com/3616612/162475467-508fd082-60a7-4a8c-b693-8b188e8843e6.png) r? ``@GuillaumeGomez``
2022-04-19Add regression test for #96079Guillaume Gomez-0/+26
2022-04-17Add regression test for rustdoc duplicated blanket implsGuillaume Gomez-0/+14
2022-04-17Remove extra space before a where clause in the documentationLoïc BRANSTETT-0/+17
2022-04-14Error on `#[rustc_deprecated]`Jacob Pratt-20/+19
2022-04-14clarify doc(cfg) wordingAndy Russell-20/+20
The current "This is supported" wording implies that it's possible to still use the item on other configurations, but in an unsupported way. Changing this to "Available" removes this ambiguity.
2022-04-14Remove use of `#[rustc_deprecated]`Jacob Pratt-8/+6
2022-04-12rustdoc: discr. required+provided assoc consts+tysLeón Orell Valerian Liehr-5/+31
2022-04-11Rollup merge of #95876 - fee1-dead:note-const-drop, r=oli-obkMatthias Krüger-6/+25
Add a note for unsatisfied `~const Drop` bounds r? ``@oli-obk``
2022-04-11Add a note for unsatisfied `~const Drop` boundsDeadbeef-6/+25
2022-04-09Rollup merge of #95769 - fmease:fix-issue-95717, r=GuillaumeGomezDylan DPC-0/+42
Hide cross-crate `#[doc(hidden)]` associated items in trait impls Fixes #95717. r? ```@GuillaumeGomez``` This is the bug I ran into in #95316. ```@rustbot``` label T-rustdoc A-cross-crate-reexports
2022-04-08Add test for empty doc comments with a backlineGuillaume Gomez-0/+22
2022-04-07Hide cross-crate doc-hidden assoc items in trait implsLeón Orell Valerian Liehr-0/+42
2022-04-07Auto merge of #95678 - pietroalbini:pa-1.62.0-bootstrap, r=Mark-Simulacrumbors-15/+5
Bump bootstrap compiler to 1.61.0 beta This PR bumps the bootstrap compiler to the 1.61.0 beta. The first commit changes the stage0 compiler, the second commit applies the "mechanical" changes and the third and fourth commits apply changes explained in the relevant comments. r? `@Mark-Simulacrum`
2022-04-06Update rustdoc test following DOM changeGuillaume Gomez-1/+1
2022-04-06remove ~const Drop from rustdoc testPietro Albini-15/+5
2022-04-05Rollup merge of #95645 - ↵Dylan DPC-0/+7
GuillaumeGomez:intra-doc-link-ice-traits-in-scope-primitive, r=jyn514 Fix intra doc link ICE when trying to get traits in scope for primitive Fixes #95633. I think ``@notriddle`` was the one who worked on this part of the code last so: r? ``@notriddle``
2022-04-05Auto merge of #95337 - petrochenkov:doclink3, r=camelidbors-0/+17
rustdoc: Fix resolution of `crate`-relative paths in doc links Resolve `crate::foo` paths transparently to rustdoc, so their resolution no longer affects diagnostics and modules used for determining traits in scope. The proper solution is to account for the current `module_id`/`parent_scope` in `fn resolve_crate_root`, but it's a slightly larger compiler changes. This PR moves the code closer to it, but keeps it rustdoc-specific. Fixes https://github.com/rust-lang/rust/issues/78696 Fixes https://github.com/rust-lang/rust/issues/94924
2022-04-04Add test to ensure rustdoc does not panic on intra doc link passGuillaume Gomez-0/+7
2022-04-03Rollup merge of #95613 - GuillaumeGomez:fix-rustdoc-attr-display, r=notriddleDylan DPC-0/+7
Fix rustdoc attribute display Fixes #81482. r? `@notriddle`
2022-04-03Add test for attribute display in rustdocGuillaume Gomez-0/+7
2022-04-02Rollup merge of #95354 - dtolnay:rustc_const_stable, r=lcnrDylan DPC-3/+3
Handle rustc_const_stable attribute in library feature collector The library feature collector in [compiler/rustc_passes/src/lib_features.rs](https://github.com/rust-lang/rust/blob/551b4fa395fa588d91cbecfb0cdfe1baa02670cf/compiler/rustc_passes/src/lib_features.rs) has only been looking at `#[stable(…)]`, `#[unstable(…)]`, and `#[rustc_const_unstable(…)]` attributes, while ignoring `#[rustc_const_stable(…)]`. The consequences of this were: - When any const feature got stabilized (changing one or more `rustc_const_unstable` to `rustc_const_stable`), users who had previously enabled that unstable feature using `#![feature(…)]` would get told "unknown feature", rather than rustc's nicer "the feature … has been stable since … and no longer requires an attribute to enable". This can be seen in the way that https://github.com/rust-lang/rust/pull/93957#issuecomment-1079794660 failed after rebase: ```console error[E0635]: unknown feature `const_ptr_offset` --> $DIR/offset_from_ub.rs:1:35 | LL | #![feature(const_ptr_offset_from, const_ptr_offset)] | ^^^^^^^^^^^^^^^^ ``` - We weren't enforcing that a particular feature is either stable everywhere or unstable everywhere, and that a feature that has been stabilized has the same stabilization version everywhere, both of which we enforce for the other stability attributes. This PR updates the library feature collector to handle `rustc_const_stable`, and fixes places in the standard library and test suite where `rustc_const_stable` was being used in a way that does not meet the rules for a stability attribute.
2022-04-01Auto merge of #95552 - matthiaskrgr:rollup-bxminn9, r=matthiaskrgrbors-0/+22
Rollup of 6 pull requests Successful merges: - #95032 (Clean up, categorize and sort unstable features in std.) - #95260 (Better suggestions for `Fn`-family trait selection errors) - #95293 (suggest wrapping single-expr blocks in square brackets) - #95344 (Make `impl Debug for rustdoc::clean::Item` easier to read) - #95388 (interpret: make isize::MAX the limit for dynamic value sizes) - #95530 (rustdoc: do not show primitives and keywords as private) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-01Rollup merge of #95475 - ↵Matthias Krüger-4/+24
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-31Adjust feature names that disagree on const stabilization versionDavid Tolnay-3/+3
2022-03-31rustdoc: do not show primitives and keywords as privateMichael Howell-0/+22
2022-03-31rustdoc: Fix resolution of `crate`-relative paths in doc linksVadim Petrochenkov-0/+17
2022-03-30Only show associated consts from inherent impls in sidebarJules Bertholet-4/+24
2022-03-30fix rustdoc wrt builtin impls switchlcnr-12/+11
2022-03-30update rustdoclcnr-2/+1
2022-03-30update ui testslcnr-0/+1
2022-03-29Auto merge of #95096 - GuillaumeGomez:rm-header-fn-field, r=camelidbors-0/+12
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-29Add test to ensure foreign functions from dependencies are correctly handledGuillaume Gomez-0/+12
2022-03-28Auto merge of #95024 - koehlma:rustdoc-private-items, ↵bors-0/+31
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-21add tests for 🔒Maximilian Köhl-0/+31
2022-03-18Add test to ensure auto-traits are respecting constraintsGuillaume Gomez-0/+8
2022-03-10Rollup merge of #94740 - GuillaumeGomez:unify-impl-blocks, r=notriddleMatthias Krüger-1/+3
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-08Update GUI tests for impl blocks path changesGuillaume Gomez-0/+2
2022-03-08Unify inherent impl blocks by wrapping them into a divGuillaume Gomez-1/+1