about summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
2025-09-29Add regression test for doc cfg applied on public items inside private itemsGuillaume Gomez-0/+16
2025-09-27Remove `doc_auto_cfg` feature as wellGuillaume Gomez-2/+2
2025-09-27Improve code comments and extend tests for `doc_cfg` featureGuillaume Gomez-0/+13
2025-09-27Fix `tests/rustdoc/target-feature.rs` test by adding missing ↵Guillaume Gomez-0/+2
`#![feature(doc_cfg)]`
2025-09-27Put back the `doc_cfg` code behind a nightly featureGuillaume Gomez-9/+8
2025-09-27Add "global" rustdoc test for RFC 3631Guillaume Gomez-0/+80
2025-09-27Update rustdoc testsGuillaume Gomez-5/+26
2025-09-26Add tests for new `tyalias` intra-doc link disambiguatorGuillaume Gomez-0/+21
2025-09-25Rollup merge of #135771 - GuillaumeGomez:jump-to-def-perf, r=fmeaseMatthias Krüger-11/+110
[rustdoc] Add support for associated items in "jump to def" feature Fixes https://github.com/rust-lang/rust/issues/135485. r? ``@fmease``
2025-09-25Rollup merge of #116882 - fmease:rustdoc-generalized-priv-repr-heuristic, ↵Matthias Krüger-136/+185
r=rustdoc rustdoc: hide `#[repr]` if it isn't part of the public ABI > [!IMPORTANT] > Temporarily stacked on top of PR https://github.com/rust-lang/rust/pull/146527; only the last commit is relevant! Follow-up to rust-lang/rust#115439. Unblocks rust-lang/rust#116743, CC ``@dtolnay.`` Fixes rust-lang/rust#66401. Fixes rust-lang/rust#128364. Fixes rust-lang/rust#137440. Only display the representation `#[repr(REPR)]` (where `REPR` is not `Rust` or `transparent`) of a given type if none of its variants (incl. the synthetic variants of structs) are `#[doc(hidden)]` and all of its fields are public and not `#[doc(hidden)]` since it's likely not meant to be considered part of the public ABI otherwise. `--document-{private,hidden}-items` works as expected in this context, too. Moreover, we now also factor in the presence of `#[doc(hidden)]` when checking whether to show `repr(transparent)` or not.
2025-09-25rustdoc: hide `#[repr(...)]` if it isn't part of the public ABILeón Orell Valerian Liehr-92/+149
2025-09-25rustdoc: Fully escape link section and export nameLeón Orell Valerian Liehr-44/+36
Escape "special characters" (e.g., double quotes `"` and line breaks `\n`). Escape HTML. Lastly, add regression tests and clean up existing tests.
2025-09-22Update tests/rustdoc/reexport/private-mod-override-reexport.rsIris Shi-1/+0
2025-09-22Move test fileIris Shi-0/+0
2025-09-22Update tests/rustdoc/private-mod-override-re-export.rsIris Shi-1/+1
Co-authored-by: lolbinarycat <dogedoge61+github@gmail.com>
2025-09-20add private module override re-export testIris Shi-0/+14
2025-09-04Auto merge of #138736 - azhogin:azhogin/sanitizers-target-modificators, ↵bors-1/+1
r=rcvalle Sanitizers target modificators Depends on bool flag fix: https://github.com/rust-lang/rust/pull/138483. Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier. Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
2025-08-28Add tests for `doc(attribute = "...")` attributeGuillaume Gomez-0/+24
2025-08-24Auto merge of #137229 - GuillaumeGomez:expand-macro, r=lolbinarycatbors-0/+28
Add support for macro expansion in rustdoc source code pages This is what it looks like: ![Screenshot From 2025-02-18 18-08-51](https://github.com/user-attachments/assets/ce2b3806-6218-47df-94bf-e9e9ed40cd41) ![image](https://github.com/user-attachments/assets/891042db-8632-4dba-9343-e28570c058fe) You can test it [here](https://rustdoc.crud.net/imperio/macro-expansion/src/lib/lib.rs.html). In this case, I also enabled the `--generate-link-to-definition` to show that both options work well together. Note: <del>There is a bug currently in firefox where the line numbers are not displayed correctly if they're inside the "macro expansion" span: https://bugzilla.mozilla.org/show_bug.cgi?id=1949948<del> Found a workaround around this bug. r? `@notriddle`
2025-08-24rustdoc: render attributes in Field and Variants sectionsKarol Zwolak-0/+4
2025-08-23rustdoc: update attribute testsKarol Zwolak-10/+71
2025-08-23Also support statements and patterns for macro expansionGuillaume Gomez-0/+28
2025-08-21-Zsanitize and -Zsanitizer-cfi-normalize-integers flags are now target ↵Andrew Zhogin-1/+1
modifiers with custom consistency check function
2025-08-15rustdoc-search: search backend with partitioned suffix treeMichael Howell-61/+62
2025-08-14rustdoc: Allow multiple references to a single footnoteTsukasa OI-1/+24
Multiple references to a single footnote is a part of GitHub Flavored Markdown syntax (although not explicitly documented as well as regular footnotes, it is implemented in GitHub's fork of CommonMark) and not prohibited by rustdoc. cf. <https://github.com/github/cmark-gfm/blob/587a12bb54d95ac37241377e6ddc93ea0e45439b/test/extensions.txt#L762-L780> However, using it makes multiple "sup" elements with the same "id" attribute, which is invalid per the HTML specification. Still, not only this is a valid GitHub Flavored Markdown syntax, this is helpful on certain cases and actually tested (accidentally) in tests/rustdoc/footnote-reference-in-footnote-def.rs. This commit keeps track of the number of references per footnote and gives unique ID to each reference. It also emits *all* back links from a footnote to its references as "↩" (return symbol) plus a numeric list in superscript. As a known limitation, it assumes that all references to a footnote are rendered (this is not always true if a dangling footnote has one or more references but considered a reasonable compromise). Also note that, this commit is designed so that no HTML changes will occur unless multiple references to a single footnote is actually used.
2025-08-10test: Add rustdoc test for enum negative overflowEval EXEC-0/+22
2025-08-10Ignore impl associated types in jump to def featureGuillaume Gomez-0/+20
2025-08-10Fix panic if an item does not have a bodyGuillaume Gomez-0/+24
2025-08-10Better handling of paths in link to def featureGuillaume Gomez-18/+58
2025-08-10Add support for trait associated itemsGuillaume Gomez-0/+15
2025-08-05rustdoc: fix caching of intra-doc links on reexportsbinarycat-0/+35
2025-08-02Rollup merge of #143662 - obi1kenobi:pg/unsafe-attribute-wrappers, r=t-rustdocSamuel Tardieu-11/+43
[rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers. Use Rust 2024 edition representation for unsafe attributes in rustdoc HTML: - `#[no_mangle]` -> `#[unsafe(no_mangle)]` - `#[export_name = "foo"]` -> `#[unsafe(export_name = "foo")]` - `#[link_section = ".text"]` -> `#[unsafe(link_section = ".text")]` The 2024 edition representation is used regardless of the crate's own edition. This ensures that Rustaceans don't have to learn the rules of an outdated edition (e.g. that `unsafe()` wasn't always necessary) in order to understand a crate's documentation. After some looking through the `T-rustdoc` issues, I was not able to find an existing issue for this. Apologies if I missed it. r? ``````@aDotInTheVoid``````
2025-08-01Rollup merge of #143849 - lolbinarycat:rustdoc-priv-normalize-143222, ↵Jacob Pratt-0/+28
r=GuillaumeGomez rustdoc: never link to unnamable items fixes rust-lang/rust#143222
2025-07-28Test renamed crates in rustdocKornel-0/+23
2025-07-23[rustdoc] Display unsafe attrs with edition 2024 `unsafe()` wrappers.Predrag Gruevski-11/+43
2025-07-22fix regression testbinarycat-3/+7
2025-07-22add regression test for RUST-143222binarycat-0/+24
2025-07-17Regression testJonathan Brouwer-0/+34
2025-07-10Add regression test for #143107Guillaume Gomez-0/+41
2025-07-04Rollup merge of #143381 - fee1-dead-contrib:push-pzxuvlnymxpu, r=GuillaumeGomezJacob Pratt-0/+36
rustdoc: don't treat methods under const impls or traits as const Fixes rust-lang/rust#143071
2025-07-03Rollup merge of #141831 - lolbinarycat:rustdoc-extern-reexport-135092, ↵Guillaume Gomez-0/+26
r=GuillaumeGomez rustdoc: fix attrs of locally reexported foreign items fixes rust-lang/rust#135092 also tweaks a few outdated/misleading comments. r? `@GuillaumeGomez`
2025-07-03rustdoc: don't treat methods under const impls or traits as constDeadbeef-0/+36
2025-07-03Rollup merge of #143083 - JonathanBrouwer:rustdoc-fix, r=jdonszelmannJana Dönszelmann-0/+13
Fix rustdoc not correctly showing attributes on re-exports Fixes attributes not being shown correctly in rustdoc on re-exports Does this need to be backported to beta? r? ``@jdonszelmann``
2025-06-29Rollup merge of #142367 - GuillaumeGomez:extern-crate-items-intra-doc, ↵Matthias Krüger-0/+23
r=lolbinarycat Add regression test for #137857 to ensure that we generate intra doc links for extern crate items. Fixes https://github.com/rust-lang/rust/issues/137857. I checked that linking to extern crates was generating valid links (with the `/index.html` part) and since it's already working, just adding a regression test. r? `@notriddle`
2025-06-28Rollup merge of #142987 - lolbinarycat:rustdoc-non_exhaustive-enum-v-142599, ↵Matthias Krüger-0/+25
r=GuillaumeGomez rustdoc: show attributes on enum variants mostly for #[non_exhaustive] unsure if there's any attributes we should take care to *not* include, it could use `render_code_attribute` and `is_non_exhaustive` instead, if that is a concern. fixes rust-lang/rust#142599
2025-06-28Add regression test for #137857 to ensure that we generate intra doc links ↵Guillaume Gomez-0/+23
for extern crate items.
2025-06-27Fix rustdoc not correctly showing attributes with re-exportsJonathan Brouwer-0/+13
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-27Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-deadMatthias Krüger-25/+25
New const traits syntax This PR only affects the AST and doesn't actually change anything semantically. All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error r? ``@fee1-dead`` cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
2025-06-27rustdoc: add regression test for issue 135092binarycat-0/+26
2025-06-26rustdoc: show attributes on enum variantsbinarycat-0/+25
mostly for #[non_exhaustive]