about summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
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
2023-04-29Restore channel placeholderwackbyte-1/+1
2023-04-29Rollup merge of #110964 - notriddle:notriddle/deref-impl, r=GuillaumeGomezMatthias Krüger-0/+43
rustdoc: fix weird margins between Deref impl items ## Before ![image](https://user-images.githubusercontent.com/1593513/235245977-90770591-22c1-4a27-9464-248a3729a2b7.png) ## After ![image](https://user-images.githubusercontent.com/1593513/235246009-0e83113e-42b7-4e29-981d-969f9d20af01.png) ## Description In the old setup, if the dereffed-to item has multiple impl blocks, each one gets its own `div.impl-items` in the section, but there are no headers separating them. Since the last method in a `div.impl-items` has no bottom margin, and there are no margins between these divs, there is no margin between the last method of one impl and the first method of the following impl. This patch fixes it by simplifying the HTML. Each Deref block gets exactly one `div.impl-items`, no matter how many impl blocks it actually has.
2023-04-28Auto merge of #110901 - GuillaumeGomez:inlined-repr-rustdoc, r=notriddlebors-0/+17
rustdoc: Fix missing `repr` attribute in doc(inline) on foreign items Fixes https://github.com/rust-lang/rust/issues/110698. r? `@notriddle`
2023-04-28rustdoc: fix weird margins between Deref impl itemsMichael Howell-0/+43
In the old setup, if the dereffed-to item has multiple impl blocks, each one gets its own `div.impl-items` in the section, but there are no headers separating them. Since the last method in a `div.impl-items` has no bottom margin, and there are no margins between these divs, there is no margin between the last method of one impl and the first method of the following impl. This patch fixes it by simplifying the HTML. Each Deref block gets exactly one `div.impl-items`, no matter how many impl blocks it actually has.
2023-04-28rustdoc: move deref tests into a directoryMichael Howell-0/+0
2023-04-28rustdoc: render visibility on associated typeswackbyte-1/+1
This should only affect inherent associated types.
2023-04-27Add regression test for #110698Guillaume Gomez-0/+17
2023-04-27test(doc): no fallback marco resolutionbohan-0/+14
2023-04-26Rollup merge of #110798 - ozkanonur:rustdoc-unused-extern-crates, r=jyn514Matthias Krüger-1/+1
pass `unused_extern_crates` in `librustdoc::doctest::make_test` blocker for https://github.com/rust-lang/rust/pull/106621
2023-04-25pass `unused_extern_crates` in `librustdoc::doctest::make_test`ozkanonur-1/+1
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-04-24Add regression test for #60522Guillaume Gomez-0/+39
2023-04-20Add regression test for #46506Guillaume Gomez-0/+24
2023-04-19Rollup merge of #110533 - ↵Matthias Krüger-0/+31
GuillaumeGomez:missing-blanket-impl-trait-not-public, r=notriddle Missing blanket impl trait not public Fixes #94183. The problem was that we should have checked if the trait was reachable instead of only "directly public". r? `@notriddle`
2023-04-19Auto merge of #110393 - fee1-dead-contrib:rm-const-traits, r=oli-obkbors-22/+26
Rm const traits in libcore See [zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/.60const.20Trait.60.20removal.20or.20rework) * [x] Bless ui tests * [ ] Re constify some unstable functions with workarounds if they are needed
2023-04-19Add regression test for #94183Guillaume Gomez-0/+31
2023-04-18Rollup merge of #110450 - GuillaumeGomez:fix-nested-items-on-private-doc, ↵Matthias Krüger-0/+64
r=notriddle,jyn514 rustdoc: Fix invalid handling of nested items with `--document-private-items` Fixes #110422. The problem is that only impl block and re-exported `macro_rules!` items are "visible" as nested items. This PR adds the missing checks to handle this correctly. cc `@compiler-errors` r? `@notriddle`
2023-04-17Add regression tests for #110422Guillaume Gomez-0/+64
2023-04-16fix library and rustdoc testsDeadbeef-22/+26
2023-04-14Rollup merge of #110279 - GuillaumeGomez:compiler-macro-derive, r=notriddleMatthias Krüger-4/+23
rustdoc: Correctly handle built-in compiler proc-macros as proc-macro and not macro Part of https://github.com/rust-lang/rust/issues/110111. There were actually one issue split in two parts: * Compiler built-in proc-macro were incorrectly considered as macros and not proc-macros. * Re-exports of compiler built-in proc-macros were considering them as macros. Both issues can be fixed by looking at the `MacroKind` variant instead of just relying on information extracted later on. r? ``@fmease``
2023-04-13Add test to ensure that compiler built-in proc-macro are considered as suchGuillaume Gomez-4/+23