about summary refs log tree commit diff
path: root/tests/rustdoc
AgeCommit message (Collapse)AuthorLines
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-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]
2025-06-26Change const trait bound syntax from ~const to [const]Oli Scherer-25/+25
2025-06-24rustdoc: Don't mark `#[target_feature]` functions as ⚠Alona Enraght-Moony-0/+38
Closes https://www.github.com/rust-lang/rust/issues/142952
2025-06-16rustdoc: `PointeeSized` bounds with extern typesDavid Wood-1/+1
As before, updating types using extern types to use `PointeeSized` bounds.
2025-06-16rustdoc: `{Meta,Pointee,}Sized` in non-minicoreDavid Wood-13/+77
Some rustdoc tests are `no_core` and need to have `MetaSized` and `PointeeSized` added to them.
2025-06-13Auto merge of #142443 - matthiaskrgr:rollup-l1l6d0v, r=matthiaskrgrbors-3/+3
Rollup of 9 pull requests Successful merges: - rust-lang/rust#128425 (Make `missing_fragment_specifier` an unconditional error) - rust-lang/rust#135927 (retpoline and retpoline-external-thunk flags (target modifiers) to enable retpoline-related target features) - rust-lang/rust#140770 (add `extern "custom"` functions) - rust-lang/rust#142176 (tests: Split dont-shuffle-bswaps along opt-levels and arches) - rust-lang/rust#142248 (Add supported asm types for LoongArch32) - rust-lang/rust#142267 (assert more in release in `rustc_ast_lowering`) - rust-lang/rust#142274 (Update the stdarch submodule) - rust-lang/rust#142276 (Update dependencies in `library/Cargo.lock`) - rust-lang/rust#142308 (Upgrade `object`, `addr2line`, and `unwinding` in the standard library) Failed merges: - rust-lang/rust#140920 (Extract some shared code from codegen backend target feature handling) r? `@ghost` `@rustbot` modify labels: rollup try-job: aarch64-apple try-job: x86_64-msvc-1 try-job: x86_64-gnu try-job: dist-i586-gnu-i586-i686-musl try-job: test-various
2025-06-13Rollup merge of #141770 - GuillaumeGomez:cfg-false-mod-rendering, r=camelidMatthias Krüger-3/+7
Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code Follow-up of https://github.com/rust-lang/rust/pull/141747. Thanks `@camelid` for spotting it! r? `@camelid`
2025-06-12Fix a missing fragment specifier in rustdoc testsTrevor Gross-3/+3
2025-06-05Support middle::ty assoc const eq predicates againLeón Orell Valerian Liehr-1/+0
2025-06-03* Add test case for `cfg(false)` on module levelGuillaume Gomez-3/+7
* Fix typo * Remove usage of `!has`
2025-05-30Rollup merge of #141747 - lolbinarycat:rustdoc-cfg-138112, r=GuillaumeGomezMatthias Krüger-0/+13
rustdoc: display doc(cfg(false)) properly before we had an extra 'on' that was ungramatical. fixes https://github.com/rust-lang/rust/issues/138112 this is what it looks like now: ![screenshot: Available nowhere](https://github.com/user-attachments/assets/e27b4990-09a7-4f13-8bcf-26d44c8c1bea)
2025-05-29rustdoc: display doc(cfg(false)) properlybinarycat-0/+13
before we had an extra 'on' that was ungramatical. fixes https://github.com/rust-lang/rust/issues/138112
2025-05-28Rollup merge of #141411 - lolbinarycat:rustdoc-link-proc-macro-91274, ↵Trevor Gross-0/+13
r=GuillaumeGomez rustdoc: linking to a local proc macro no longer warns fixes https://github.com/rust-lang/rust/issues/91274 tried to keep the fix general in case we ever have any other kind of item that occupies multiple namespaces simultaniously.
2025-05-27Rollup merge of #141517 - ↵Trevor Gross-0/+23
lolbinarycat:rustdoc-doctest-tooltip-ignore-141092, r=notriddle rustdoc: use descriptive tooltip if doctest is conditionally ignored fixes https://github.com/rust-lang/rust/issues/141092 here's what it looks like now: ![screenshot](https://github.com/user-attachments/assets/71e679fe-8828-439d-a2ce-b9187ad3aeea)
2025-05-27rustdoc: linking to a local proc macro no longer warnsbinarycat-0/+13
fixes https://github.com/rust-lang/rust/issues/91274 Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2025-05-25Add regression test for #140739Guillaume Gomez-0/+42
2025-05-25Tweak attribute rendering depending on wether or not it is a type aliasGuillaume Gomez-1/+1
2025-05-24rustdoc: use descriptive tooltip if doctest is conditionally ignoredbinarycat-0/+23
fixes https://github.com/rust-lang/rust/issues/141092
2025-05-05Created `tests/rustdoc/async` subfolder to limit number of files at the top ↵Guillaume Gomez-0/+0
level
2025-05-05Created `tests/rustdoc/extern` subfolder to limit number of files at the top ↵Guillaume Gomez-0/+6
level
2025-05-05Move primitive rustdoc tests into the `primitive` sub folderGuillaume Gomez-0/+0
2025-05-05Created `tests/rustdoc/enum` subfolder to limit number of files at the top levelGuillaume Gomez-0/+0
2025-05-05Created `tests/rustdoc/assoc` subfolder to limit number of files at the top ↵Guillaume Gomez-0/+0
level
2025-05-05Created `tests/rustdoc/impl` subfolder to limit number of files at the top levelGuillaume Gomez-0/+0
2025-05-05Created `tests/rustdoc/doc-cfg` subfolder to limit number of files at the ↵Guillaume Gomez-0/+0
top level
2025-05-05Created `tests/rustdoc/macro` subfolder to limit number of files at the top ↵Guillaume Gomez-0/+20
level
2025-05-05Created `tests/rustdoc/private` subfolder to limit number of files at the ↵Guillaume Gomez-0/+0
top level
2025-05-05Move intra-doc tests into the expected subfolderGuillaume Gomez-0/+0