summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
2023-06-27Rollup merge of #113058 - GuillaumeGomez:improve-code-comments, r=notriddleMatthias Krüger-1/+1
Add/improve code comments Working on something else and did some small comments updates/adds. r? `@notriddle`
2023-06-26Add/improve code commentsGuillaume Gomez-1/+1
2023-06-26Rollup merge of #112920 - fmease:rustdoc-fix-112904, r=GuillaumeGomezTakayuki Maeda-0/+29
rustdoc: render generic params & where-clauses of cross-crate assoc tys in impls We used to only ever render generic parameters & where-clauses of cross-crate associated types when the item was located inside of a trait and we used to just drop them when it was inside of an impl block (trait or inherent). Fixes #112904. `@rustbot` label A-cross-crate-reexports
2023-06-25Auto merge of #113038 - matthiaskrgr:rollup-sdcfkxa, r=matthiaskrgrbors-0/+14
Rollup of 5 pull requests Successful merges: - #112976 (Add test for futures with HRTB) - #113013 (rustdoc: get rid of extra line when line-wrapping fn decls with empty arg list) - #113030 (Add a regression test for #109071) - #113031 (Add a regression test for #110933) - #113036 (Accept `ReStatic` for RPITIT) r? `@ghost` `@rustbot` modify labels: rollup
2023-06-25rustdoc: handle assoc const equalities in cross-crate impl-Trait-in-arg-posLeón Orell Valerian Liehr-0/+15
2023-06-24rustdoc: get rid of extra line when line-wrapping fn decls with empty arg listLeón Orell Valerian Liehr-0/+14
2023-06-24rustdoc: render gen params & where-clauses of cross-crate assoc tys in impl ↵León Orell Valerian Liehr-0/+29
blocks
2023-06-23Rollup merge of #112960 - GuillaumeGomez:rustdoc-files-check, r=notriddleMatthias Krüger-0/+17
[tests/rustdoc] Add @files command The ``````@!has`````` checks is very problematic as it wouldn't catch if the file scheme is updated and the file is generated again. ``````@files`````` allows to ensure that the given folder contains exactly the provided entries (files and folders). I'm wondering if we should forbid the ``````@!has`````` for files. To be discussed after this PR I suppose. r? `````@notriddle`````
2023-06-23Add @files checks in rustdoc testsGuillaume Gomez-0/+17
2023-06-23Rollup merge of #112927 - GuillaumeGomez:where-clause-indent, r=notriddleMatthias Krüger-1/+20
Fix indentation for where clause in rustdoc pages Screenshot of the bug: ![image](https://github.com/rust-lang/rust/assets/3050060/090cfeaa-0edc-46c7-9ea0-e26ac865b2c2) I used this opportunity to clarify the code a bit because some weird things were going on. r? ````@notriddle````
2023-06-22Update existing snapshot and add more snapshots of where clause indentationGuillaume Gomez-1/+20
2023-06-22Rollup merge of #112906 - ↵Matthias Krüger-2/+2
fmease:rustdoc-render-assoc-ty-body-before-where-clause, r=notriddle rustdoc: render the body of associated types before the where-clause Fixes #112903.
2023-06-21rustdoc: render the assoc ty body before the where-clauseLeón Orell Valerian Liehr-2/+2
2023-06-21Rollup merge of #112894 - GuillaumeGomez:gui-fields-display, r=notriddleGuillaume Gomez-0/+11
Fix union fields display ![Screenshot from 2023-06-21 16-47-24](https://github.com/rust-lang/rust/assets/3050060/833b0fe6-7fb6-4371-86c3-d82fa0c3fe49) So two bugs in this screenshot: no whitespace between field name and type name, both fields are on the same line. Both problems come from issues in the templates because all whitespace are removed if a askama "command" follows. r? `@notriddle`
2023-06-21Add test to prevent regression for fields displayGuillaume Gomez-0/+11
2023-06-21Rollup merge of #112853 - GuillaumeGomez:type_alias_type, r=oli-obkGuillaume Gomez-0/+47
Add `lazy_type_alias` feature gate Add the `type_alias_type` to be able to have the weak alias used without restrictions. Part of #112792. cc `@compiler-errors` r? `@oli-obk`
2023-06-21Correctly handle Weak type aliases in rustdocGuillaume Gomez-4/+2
2023-06-21Add tests for invalid files generationGuillaume Gomez-4/+81
2023-06-21Add rustdoc tests for `lazy_type_alias`Guillaume Gomez-0/+49
2023-06-15Rollup merge of #112304 - GuillaumeGomez:re-exports, r=notriddleMatthias Krüger-0/+143
Add chapter in rustdoc book for re-exports and add a regression test for `#[doc(hidden)]` behaviour Fixes https://github.com/rust-lang/rust/issues/109449. Fixes https://github.com/rust-lang/rust/issues/53417. After the discussion in #109697, I made a few PRs to fix a few corner cases: * https://github.com/rust-lang/rust/pull/112178 * https://github.com/rust-lang/rust/pull/112108 * https://github.com/rust-lang/rust/pull/111997 With this I think I covered all cases. Only thing missing at this point was a chapter covering re-exports in the rustdoc book. r? `@notriddle`
2023-06-12Add regression test for #112515Guillaume Gomez-0/+30
2023-06-12Revert "Add regression test for #32077"Guillaume Gomez-59/+0
This reverts commit 6f552c800b38b3e71c5e33a295e8b490d2018c71.
2023-06-10Auto merge of #107637 - fmease:rustdoc-reelide-x-crate-def-tr-obj-lt-bnds, ↵bors-19/+167
r=notriddle,cgillot,GuillaumeGomez rustdoc: re-elide cross-crate default trait-object lifetime bounds Hide trait-object lifetime bounds (re-exported from an external crate) if they coincide with [their default](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes). Partially addresses #44306. Follow-up to #103885. [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/clean_middle_ty.3A.20I.20need.20to.20add.20a.20parameter/near/307143097). Most notably, if `std` exported something from `core` containing a type like `Box<dyn Fn()>`, then it would now be rendered as `Box<dyn Fn(), Global>` instead of `Box<dyn Fn() + 'static, Global>` (hiding `+ 'static` as it is the default in this case). Showing `Global` here is a separate issue, #80379, which is on my agenda. Note that I am not really fond of the fact that I had to add a parameter to such a widely used function (30+ call sites) to address such a niche bug. CC `@GuillaumeGomez` Requesting a review from a compiler contributor or team member as recommended on Zulip. r? compiler --- `@rustbot` label T-compiler T-rustdoc A-cross-crate-reexports
2023-06-09Add regression test for #32077Guillaume Gomez-0/+59
2023-06-07rustdoc: re-elide cross-crate default trait object lifetime boundsLeón Orell Valerian Liehr-19/+167
2023-06-05Add rustdoc test to ensure that #109449 is working as expectedGuillaume Gomez-0/+143
2023-06-05Auto merge of #110945 - wackbyte:doc-vis-on-inherent-assoc-types, r=jshabors-1/+26
rustdoc: render visibility on associated types This should only affect inherent associated types (#8995).
2023-06-04Rollup merge of #112178 - GuillaumeGomez:fix-inline-private-intermediate, ↵Matthias Krüger-2/+25
r=notriddle Fix bug where private item with intermediate doc hidden re-export was not inlined This fixes this bug: ```rust mod private { /// Original. pub struct Bar3; } /// Hidden. #[doc(hidden)] pub use crate::private::Bar3; /// Visible. pub use self::Bar3 as Reexport; ``` In this case, `private::Bar3` should be inlined and renamed `Reexport` but instead we have: ``` pub use self::Bar3 as Reexport; ``` and no links. There were actually two issues: the first one is that we forgot to check if the next intermediate re-export was doc hidden. The second was that we made the `#[doc(hidden)]` attribute inheritable, which shouldn't be possible. r? `@notriddle`
2023-06-03Update reexport-attr-merge rustdoc testGuillaume Gomez-2/+2
2023-06-02Add rustdoc test for double-hyphen to dash doc comment conversionGuillaume Gomez-0/+9
2023-06-01Add regression test where private item with intermediate doc hidden ↵Guillaume Gomez-0/+23
re-export was not inlined
2023-06-01Rollup merge of #108459 - benediktwerner:rustdoc-fix-link-match, ↵Dylan DPC-1/+38
r=GuillaumeGomez rustdoc: Fix LinkReplacer link matching It currently just uses the first link with the same href which might not necessarily be the matching one. This fixes replacements when there are several links to the same item but with different text (e.g. `[X] and [struct@X]`). It also fixes replacements in summaries since those use a links list with empty hrefs, so currently all links would always match the first link by href but then not match its text. This could also lead to a panic in the `original_lext[1..len() - 1]` part when the first link only has a single character, which is why the new code uses `.get(..)` instead.
2023-05-30rustdoc: Fix LinkReplacer link matchingbenediktwerner-1/+38
2023-05-30Add regression test for re-export of doc hidden item inside private item not ↵Guillaume Gomez-0/+16
displayed
2023-05-27Rollup merge of #111997 - GuillaumeGomez:re-export-doc-hidden-macros, ↵Guillaume Gomez-3/+44
r=notriddle Fix re-export of doc hidden macro not showing up It's part of the follow-up of https://github.com/rust-lang/rust/pull/109697. Re-exports of doc hidden macros should be visible. It was the only kind of re-export of doc hidden item that didn't show up. r? `@notriddle`
2023-05-27Correctly handle multiple re-exports of bang macros at the same levelGuillaume Gomez-1/+43
2023-05-26Update tests for re-exports of doc hidden macrosGuillaume Gomez-3/+2
2023-05-25rustdoc: add test for strikethrough with single tildesLukas Markeffsky-9/+10
Also merge the two almost identical strikethrough tests together and document what the test tests.
2023-05-21rustdoc: include strikethrough in item summaryLukas Markeffsky-0/+6
2023-05-16Add regression test for #111415Guillaume Gomez-0/+36
2023-05-10Use proper impl self type for alias impl in rustdocMichael Goulet-0/+9
2023-05-10Rollup merge of #111095 - GuillaumeGomez:fix-assoc-item-trait-inside-hidden, ↵Matthias Krüger-0/+52
r=notriddle Correctly handle associated items of a trait inside a `#[doc(hidden)]` item Fixes https://github.com/rust-lang/rust/issues/111064. cc `@compiler-errors` r? `@notriddle`
2023-05-05Add regression test for #111064Guillaume Gomez-0/+52
2023-05-04IAT: Rustdoc integrationLeón Orell Valerian Liehr-4/+79
2023-05-04IAT: Introduce AliasKind::InherentLeón Orell Valerian Liehr-0/+14
2023-04-30Rollup merge of #110631 - notriddle:notriddle/impl-trait-cycle, r=GuillaumeGomezMatthias Krüger-0/+19
rustdoc: catch and don't blow up on impl Trait cycles Fixes #110629 An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay: type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>; type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>; To get it right, track every time rustdoc descends into a type alias, so if it shows up twice, it can be write the path instead of infinitely expanding it.
2023-04-29rustdoc: catch and don't blow up on impl Trait cyclesMichael Howell-0/+19
An odd feature of Rust is that `Foo` is invalid, but `Bar` is okay: type Foo<'a, 'b> = Box<dyn PartialEq<Foo<'a, 'b>>>; type Bar<'a, 'b> = impl PartialEq<Bar<'a, 'b>>; To get it right, track every time rustdoc descends into a type alias, so if it shows up twice, it can be write the path instead of infinitely expanding it.
2023-04-30Rollup merge of #110983 - GuillaumeGomez:foreign-repr, r=notriddleMatthias Krüger-5/+39
rustdoc: Get `repr` information through `AdtDef` for foreign items As suggested by `@notriddle,` this approach works too. The only downside is that the display of the original attribute isn't kept, but I think it's an acceptable downside. r? `@notriddle`
2023-04-29Extend foreign inlined item with `#[repr()]` testGuillaume Gomez-5/+39
2023-04-29Add visibility tests for associated itemswackbyte-0/+25