summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
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-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-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
2023-04-12Split out a separate feature gate for impl trait in associated typesOli Scherer-1/+1
2023-04-05Bless rustdoc test with swapped idsRémy Rakic-2/+2
The ids for the multiple `Item` associated type elements are swapped between the first and second impl.
2023-04-04Rollup merge of #109937 - compiler-errors:rustdoc-rpit-cant-be-documented, ↵Michael Goulet-0/+15
r=GuillaumeGomez Don't collect return-position impl traits for documentation #104889 modified the rustdoc ast collection step to use a HIR visitor, which more thoroughly walks the HIR tree. that means that we're going to encounter inner items (incl return-position impl traits and async fn opaque futures) that are not possible to document. FIxes (but does not close due to being a beta regression) #109931 r? `@GuillaumeGomez`
2023-04-04Rollup merge of #109919 - fmease:rustdoc-fix-issue-109488, r=notriddleMichael Goulet-0/+18
rustdoc: escape GAT args in more cases Fixes #109488. Previously we printed the *un*escaped form of GAT arguments not only when `f.alternate()` was true but *also* when we failed to compute the URL of the trait associated with the type projection, i.e. when `href(…)` returned an `Err(_)`. In this PR the argument printing logic is entirely separate from the link resolution code above as it should be. Further, we now only try to compute the URL if the HTML format was requested with `!f.alternate()`. Before, we would sometimes compute the `href` only to throw it away later.
2023-04-04Don't collect return-position impl traits for documentationMichael Goulet-0/+15
2023-04-04rustdoc: escape GAT args in more casesLeón Orell Valerian Liehr-0/+18
2023-03-30Update tests for rustc_doc_primitiveGuillaume Gomez-35/+38
2023-03-30Rollup merge of #109509 - ehuss:overlapping-tests, r=Mark-SimulacrumYuki Okushi-0/+0
compiletest: Don't allow tests with overlapping prefix names Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path, or otherwise clash with it while the two tests are trying to create/delete/modify the same directory. In practice, this manifested as a random error on macOS where two tests were trying to create/delete/create `rustdoc/primitive` and `rustdoc/primitive/no_std`, which resulted in an EINVAL (InvalidInput) error. This renames some of the offending tests, adds `compiletest-ignore-dir` to prevent compiletest from processing some files, and adds a check to prevent this from happening in the future. Fixes #109397
2023-03-29Rollup merge of #109726 - GuillaumeGomez:doc-hidden-crate, r=notriddleMatthias Krüger-0/+8
rustdoc: Don't strip crate module Until we decide something for https://github.com/rust-lang/rust/issues/109695, rustdoc won't crash anymore because the crate folder doesn't exist. r? `@notriddle`
2023-03-29Add regression test for #109695Guillaume Gomez-0/+8
2023-03-29Rollup merge of #109534 - petrochenkov:noprimuse, r=GuillaumeGomezDylan DPC-1/+1
rustdoc: Unsupport importing `doc(primitive)` and `doc(keyword)` modules These are internal features used for a specific purpose, and modules without imports are enough for that purpose.
2023-03-28rustdoc + rustdoc-json support for non_lifetime_bindersMichael Goulet-0/+9
2023-03-28rustdoc: Unsupport importing `doc(primitive)` and `doc(keyword)` modulesVadim Petrochenkov-1/+1
These are internal features used for a specific purpose, and modules without imports are enough for that purpose.
2023-03-27Bless tidyMaybe Waffle-1/+0
2023-03-26rustdoc: tweak `some variants omitted`Ezra Shaw-0/+11
Don't display `// some variants omitted` if enum is marked `#[non_exhaustive]`
2023-03-22Rename tests to ensure they don't have overlapping names.Eric Huss-0/+0
Some tests will delete their output directory before starting. The output directory is based on the test names. If one test is the prefix of another test, then when that test starts, it could try to delete the output directory of the other test with the longer path.
2023-03-22Rollup merge of #108954 - notriddle:notriddle/notable-trait-generic, r=camelidMatthias Krüger-0/+41
rustdoc: handle generics better when matching notable traits This commit makes the `clean::Type::is_same` non-commutative (renaming it `is_doc_subtype_of`), so that a generic `impl` matches a concrete return, but a generic return does not match a concrete `impl`. It makes slice and vector Write for `u8` not match on every generic return value. Fixes #100322 Fixes #55082 Preview: * https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/vec/struct.Vec.html#method.new * https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/vec/struct.Vec.html#method.from-12 * https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/iter/trait.Iterator.html#method.intersperse_with * https://notriddle.com/rustdoc-demo-html-3/notable-trait-generic/std/string/struct.String.html#method.as_bytes