about summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
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
2023-03-20Rollup merge of #109375 - clubby789:unescape-deprecated-doc, r=jshaMatthias Krüger-2/+2
rustdoc: Fix improper escaping of deprecation reasons Fix #109374 r? `@jsha`
2023-03-20Rollup merge of #109351 - GuillaumeGomez:no-footnote-in-summary, r=notriddleMatthias Krüger-0/+17
rustdoc: Remove footnote references from doc summary Since it's one line, we don't have the footnote definition so it doesn't make sense to have the reference. Part of https://github.com/rust-lang/rust/issues/109024. r? `@notriddle`
2023-03-20Rollup merge of #109259 - GuillaumeGomez:fix-missing-private-inlining, ↵Matthias Krüger-0/+27
r=notriddle rustdoc: Fix missing private inlining Fixes https://github.com/rust-lang/rust/issues/109258. If the item isn't inlined, it shouldn't have been added into `view_item_stack`. The problem here was that it was not removed, preventing sub items to be inlined if they have a re-export in "upper levels". cc `@epage` r? `@notriddle`
2023-03-20Fix improper escaping of deprecation reasonsclubby789-2/+2
2023-03-19Add test for footnote references in doc summaryGuillaume Gomez-0/+17
2023-03-17Add regression test for #109258Guillaume Gomez-0/+27
2023-03-15rustdoc: remove `std::` from primitive intra-doc link tooltipsMichael Howell-0/+2
2023-03-13rustdoc: fix comments in testMichael Howell-4/+4
2023-03-10Rollup merge of #108936 - GuillaumeGomez:rustdoc-anonymous-reexport, r=notriddleMatthias Krüger-2/+27
Rustdoc: don't hide anonymous reexport Fixes https://github.com/rust-lang/rust/issues/108931. From https://github.com/rust-lang/rust/issues/108931, it appears that having anonymous re-exports for traits is actually used in some places, so instead of hiding them automatically, we should prevent them to be ever inlined. r? `@notriddle`
2023-03-09rustdoc: handle generics better when matching notable traitsMichael Howell-0/+41
This commit makes the `clean::Type::is_same` non-commutative, 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.
2023-03-09rustdoc: move notable trait tests into their own directoryMichael Howell-0/+0
2023-03-09Update rustdoc anonymous reexport test and add regression test for #108931Guillaume Gomez-2/+27
2023-03-09Rollup merge of #108870 - ↵Matthias Krüger-0/+29
GuillaumeGomez:rustdoc-reexport-of-reexport-of-private, r=notriddle Fix invalid inlining of reexport of reexport of private item Fixes https://github.com/rust-lang/rust/issues/108679. The problem is that a reexport is always resolving to the end type, so if the end type is private, the reexport inlines. Except that if you reexport a public reexport (which reexports the private item), then it should not be inlined again. r? `@notriddle`
2023-03-08Auto merge of #108121 - aliemjay:resolve-var-region, r=lcnrbors-2/+2
always resolve to universal regions if possible `RegionConstraintCollector::opportunistic_resolve_var`, which is used in canonicalization and projection logic, doesn't resolve the region var to an equal universal region. So if we have equated `'static == '1 == '2`, it doesn't resolve `'1` or `'2` to `'static`. Now it does! Addresses review comment https://github.com/rust-lang/rust/pull/107376#discussion_r1093233687. r? `@lcnr`
2023-03-07Addr regression test for #108679Guillaume Gomez-0/+29
2023-03-05bless rustdoc testsAli MJ Al-Nasrawy-2/+2
2023-03-04rustdoc: Note in a type's layout/size if it is uninhabitedclubby789-0/+8
2023-02-23rustdoc: avoid including `<li>` tags in item table short descMichael Howell-0/+10
Fixes a bug seen at https://docs.rs/gl_constants/0.1.1/gl_constants/index.html
2023-02-23Rollup merge of #108349 - GuillaumeGomez:fix-duplicated-imports2, r=notriddleMatthias Krüger-0/+26
rustdoc: Prevent duplicated imports Fixes #108163. Interestingly enough, the AST is providing us an import for each corresponding item, even though the `Res` links to multiple ones each time, which leaded to the same import being duplicated. So in this PR, I decided to prevent the add of the import before the clean pass. However, I originally took a different path by instead filtering after cleaning the path. You can see it [here](https://github.com/rust-lang/rust/compare/master...GuillaumeGomez:rust:fix-duplicated-imports?expand=1). Only the second commit differs. I think this approach is better though, but at least we can compare both if we want. The first commit adds the check for duplicated items in the rustdoc-json output as asked in #108163. cc `@aDotInTheVoid` r? `@notriddle`
2023-02-22Add test to ensure there are no duplicated importsGuillaume Gomez-0/+26
2023-02-22rustdoc: update test case with intra-doc link pointing to methodMichael Howell-4/+12
2023-02-22Rollup merge of #108310 - ↵Guillaume Gomez-0/+25
GuillaumeGomez:fix-reexports-duplicated-attributes, r=notriddle rustdoc: Fix duplicated attributes for first reexport Fixes #108281. r? ``@notriddle``
2023-02-21Add regression test for #108281Guillaume Gomez-0/+25
2023-02-20Rollup merge of #108241 - GuillaumeGomez:fix-reexported-macro-handling, ↵Matthias Krüger-0/+45
r=notriddle Fix handling of reexported macro in doc hidden items Fixes https://github.com/rust-lang/rust/issues/108231. Fixes #59368. r? `@notriddle`
2023-02-20Add test for reexported hidden macroGuillaume Gomez-0/+22
2023-02-20Add regression test for #108231Guillaume Gomez-0/+23
2023-02-19Rollup merge of #108129 - ↵Guillaume Gomez-0/+28
GuillaumeGomez:correctly-handle-links-starting-with-whitespace, r=petrochenkov Correctly handle links starting with whitespace Part of https://github.com/rust-lang/rust/issues/107995. I just got this issue, wrote a fix and then saw the issue. So here's the PR. ^^' r? `@petrochenkov`
2023-02-19Rollup merge of #107783 - notriddle:notriddle/item-table-ul, r=GuillaumeGomezDylan DPC-43/+43
rustdoc: simplify DOM for `.item-table` This switches from using `<div>` to the more semantic `<ul>`, and using class names that rhyme with the classes the search results table uses.
2023-02-18Add regression test for #107995Guillaume Gomez-0/+28
2023-02-16Rollup merge of #108057 - GuillaumeGomez:fix-reexport-attr-merge, r=notriddleMatthias Krüger-0/+33
Prevent some attributes from being merged with others on reexports Final fix for https://github.com/rust-lang/rust/issues/59368. As discussed on zulip [here](https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/Filtering.20sub.20attributes.20in.20ast.3A.3AAttribute), we need to clone the `Attribute` to be able to filter some parts of it. Then we need to go through the attributes to able to only keep what we want (everything except a few attributes in short). As for the second commit, when I wrote the test, I realized that the code to traverse all reexports one by one to collect all their attributes was not completely working so I fixed the few issues remaining. r? `@notriddle`
2023-02-15Correctly handle reexports of `#[doc(hidden)]` is reexport does not use ↵Guillaume Gomez-3/+10
`#[doc(inline)]`
2023-02-14Add test for reexports attr mergeGuillaume Gomez-0/+26
2023-02-13rustdoc: add more tooltips to intra-doc linksMichael Howell-0/+17
This commit makes intra-doc link tooltips consistent with generated links in function signatures and item tables, with the format `itemtype foo::bar::baz`. This way, you can tell if a link points at a trait or a type (for example) by mousing over it. See also fce944d4e79b3a87ddf511206724edf33acfd704
2023-02-13Rollup merge of #107340 - notriddle:notriddle/simplify-doctest-tooltip, ↵Matthias Krüger-5/+5
r=GuillaumeGomez rustdoc: merge doctest tooltip with notable traits tooltip Fixes https://discord.com/channels/442252698964721669/443150878111694848/1066420140167680000 <details><summary>a user report where the tooltip arrow overlaps the text</summary> ![](https://cdn.discordapp.com/attachments/443150878111694848/1066420139530145812/this-example-is-not-tested-busted-rendering.png) </details> Fixes #91100 Preview: <https://notriddle.com/notriddle-rustdoc-demos/simplify-doctest-tooltip/std/vec/struct.Vec.html#indexing> Screenshot: ![image](https://user-images.githubusercontent.com/1593513/214975516-72667632-4609-49fa-8c37-e8d2ba1ba7dc.png)
2023-02-12Rollup merge of #107934 - ↵Matthias Krüger-0/+6
notriddle:notriddle/intra-doc-link-meta-description, r=camelid,GuillaumeGomez rustdoc: account for intra-doc links in `<meta name="description">` Similar to #86451, but for the SEO descriptions instead of the search descriptions.
2023-02-11rustdoc: account for intra-doc links in `<meta name="description">`Michael Howell-0/+6
2023-02-11Rollup merge of #107897 - GuillaumeGomez:reexported-macros-docs, r=notriddleMatthias Krüger-0/+23
Reexported macros docs Part of #59368 (doesn't fix it, only improve the current situation a bit). Macros were not correctly handled in reexports and the reexport attributes were not merged with the item either. This PR fixes both. r? `@notriddle`
2023-02-11Rollup merge of #107490 - notriddle:notriddle/rm-sidebar-tooltip, ↵Dylan DPC-27/+0
r=GuillaumeGomez rustdoc: remove inconsistently-present sidebar tooltips Discussed in https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Inconsistent.20sidebar.20tooltips/near/323565625
2023-02-10Add regression test for reexported macros docsGuillaume Gomez-0/+23