about summary refs log tree commit diff
path: root/tests/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2025-10-03Rollup merge of #147292 - Urgau:rustdoc-test-unstable_opts, r=fmeaseMatthias Krüger-134/+211
Respect `-Z` unstable options in `rustdoc --test` This PR makes rustdoc respect `-Z` unstable options when collecting doctests (`rustdoc --test`). In the process I also realized that `--error-format` wasn't respected as well, making UI annotations impossible to write so I fixed that as well. Best reviewed commit by commit. Fixes https://github.com/rust-lang/rust/issues/147276 Fixes https://github.com/rust-lang/rust/issues/143930 r? fmease
2025-10-03Add regression test for `-Zcrate-attr` in `rustdoc --test`Urgau-0/+54
2025-10-03Respect `--error-format` in `rustdoc --test`Urgau-28/+51
2025-10-03Respect `-Z` unstable options in `rustdoc --test`Urgau-119/+119
2025-09-29Move doc cfg propagation pass before items stripping passesGuillaume Gomez-2/+2
2025-09-27Rollup merge of #147032 - ↵Matthias Krüger-8/+14
GuillaumeGomez:fix-doctest-compilation-time-display, r=lolbinarycat Fix doctest compilation time display Fixes rust-lang/rust#146960. Small corner case that happened in case everything went fine and there was only merged doctests. r? lolbinarycat
2025-09-27Apply first review round suggestionsGuillaume Gomez-3/+3
2025-09-27Improve code comments and extend tests for `doc_cfg` featureGuillaume Gomez-1/+15
2025-09-27Improve code and better check `doc(cfg(...))` attributesGuillaume Gomez-36/+128
2025-09-27Add code documentation, improve code and improve error messageGuillaume Gomez-2/+2
2025-09-27Put back the `doc_cfg` code behind a nightly featureGuillaume Gomez-5/+7
2025-09-27Strenghten checks for `doc(auto_cfg(show/hide))` attributesGuillaume Gomez-1/+8
2025-09-27Update rustdoc testsGuillaume Gomez-37/+35
2025-09-26Add regression test for merged doctests compilation time displayGuillaume Gomez-8/+14
2025-09-26Add tests for new `tyalias` intra-doc link disambiguatorGuillaume Gomez-0/+74
2025-09-22fix ICE in rustdoc::invalid_html_tagsbinarycat-0/+63
2025-09-10Add new ui tests for `rustdoc::bare_urls`Guillaume Gomez-1/+97
2025-08-28Add ui test for unsupported `doc(attribute = "...")` case for attributes ↵Guillaume Gomez-0/+17
with namespace
2025-08-28Add tests for `doc(attribute = "...")` attributeGuillaume Gomez-0/+28
2025-08-26Rollup merge of #145535 - lolbinarycat:rustdoc-invalid_html_tags-svg-145529, ↵Stuart Cook-12/+153
r=GuillaumeGomez make rustdoc::invalid_html_tags more robust best reviewed a commit at a time. I kept finding more edge case so I ended up having to make quite significant changes to the parser in order to make it preserve state across events and handle multiline attributes correctly. fixes rust-lang/rust#145529
2025-08-22Bless rustdoc-ui.Camille Gillot-8/+6
2025-08-21refactor rustdoc::invalid_html_tags tag parserbinarycat-19/+117
previously, this lint did not distinguish between `<img` and `<img>`, and since the latter should be accepted under html5, the former was also accepted. the parser now also handles multi-line tags and multi-line attributes.
2025-08-21add regression test for #145529binarycat-1/+44
2025-08-14Update uitestsJonathan Brouwer-2/+2
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-12Rollup merge of #144921 - lolbinarycat:rustdoc-intra-doc-gfm-141866, ↵Stuart Cook-0/+6
r=fmease,GuillaumeGomez Don't emit `rustdoc::broken_intra_doc_links` for GitHub-flavored Markdown admonitions like `[!NOTE]` fixes rust-lang/rust#141866
2025-08-11don't emit rustdoc::broken_intra_doc_links for stuff like [!NOTE]binarycat-0/+6
2025-08-06Print thread ID in panic message if thread name is unknownTrevor Gross-6/+6
`panic!` does not print any identifying information for threads that are unnamed. However, in many cases, the thread ID can be determined. This changes the panic message from something like this: thread '<unnamed>' panicked at src/main.rs:3:5: explicit panic To something like this: thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5: explicit panic Stack overflow messages are updated as well. This change applies to both named and unnamed threads. The ID printed is the OS integer thread ID rather than the Rust thread ID, which should also be what debuggers print.
2025-08-02Rollup merge of #132748 - ↵Samuel Tardieu-22/+261
lolbinarycat:rustdoc-intra-doc-link-warn-more-54191, r=GuillaumeGomez get rid of some false negatives in rustdoc::broken_intra_doc_links rustdoc will not try to do intra-doc linking if the "path" of a link looks too much like a "real url". however, only inline links (`[text](url)`) can actually contain a url, other types of links (reference links, shortcut links) contain a *reference* which is later resolved to an actual url. the "path" in this case cannot be a url, and therefore it should not be skipped due to looking like a url. fixes https://github.com/rust-lang/rust/issues/54191 to minimize the number of false positives that will be introduced, the following heuristic is used: If there's no backticks, be lenient revert to old behavior. This is to prevent churn by linting on stuff that isn't meant to be a link. only shortcut links have simple enough syntax that they are likely to be written accidentlly, collapsed and reference links need 4 metachars, and reference links will not usually use backticks in the reference name. therefore, only shortcut syntax gets the lenient behavior. here's a truth table for how link kinds that cannot be urls are handled: | | is shortcut link | not shortcut link | |--------------|--------------------|-------------------| | has backtick | never ignore | never ignore | | no backtick | ignore if url-like | never ignore |
2025-07-30Rollup merge of #144308 - GuillaumeGomez:merged-doctest-times, r=lolbinarycatSamuel Tardieu-96/+135
[rustdoc] Display total time and compilation time of merged doctests Fixes rust-lang/rust#144270. Does it look good to you `@kpreid?` <img width="908" height="263" alt="image" src="https://github.com/user-attachments/assets/cd5d082d-c4e0-42ed-91dd-bd263b413dcd" />
2025-07-28feat: Right align line numbersScott Schafer-1/+1
2025-07-24move bad-intra-doc test into intra-doc dirbinarycat-0/+0
2025-07-24rustdoc::broken_intra_doc_links: only be lenient with shortcut linksbinarycat-2/+10
collapsed links and reference links have a pretty particular syntax, it seems unlikely they would show up on accident. Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2025-07-24rustdoc: update tests to match new lint behaviorbinarycat-25/+3
2025-07-24adjust more unit tests to reflect more aggressive intra-doc lintingbinarycat-21/+230
2025-07-24get rid of some false negatives in rustdoc::broken_intra_doc_linksbinarycat-0/+44
rustdoc will not try to do intra-doc linking if the "path" of a link looks too much like a "real url". however, only inline links ([text](url)) can actually contain a url, other types of links (reference links, shortcut links) contain a *reference* which is later resolved to an actual url. the "path" in this case cannot be a url, and therefore it should not be skipped due to looking like a url. Co-authored-by: Michael Howell <michael@notriddle.com>
2025-07-24Update rustdoc ui testsGuillaume Gomez-96/+135
2025-07-17Specify of_trait in Target::Impl.Camille GILLOT-2/+2
2025-07-03refactor: Make -Ztrack-diagnostics emit like a noteScott Schafer-3/+6
2025-06-30Replace `ItemCtxt::report_placeholder_type_error` `match` with a call to ↵Guillaume Gomez-2/+2
`TyCtxt::def_descr`
2025-06-23Improve code and documentationGuillaume Gomez-3/+31
2025-06-23Add ui test for `redundant_explicit_links` rustdoc lint for items coming ↵Guillaume Gomez-0/+51
from expansion
2025-06-16rustdoc: `{Meta,Pointee,}Sized` in non-minicoreDavid Wood-4/+16
Some rustdoc tests are `no_core` and need to have `MetaSized` and `PointeeSized` added to them.
2025-06-10Add new extracted option doctest ui test for result returning doctestGuillaume Gomez-0/+12
2025-06-10Give more information into extracted doctest informationGuillaume Gomez-1/+1
2025-06-08Auto merge of #142008 - RalfJung:const-eval-error-here, r=oli-obkbors-1/+1
const-eval error: always say in which item the error occurred I don't see why "is this generic" should make a difference. It may be reasonable to key this on whether the error occurs in a `const fn` that was invoked by a const (making it non-obvious which constant it is) vs inside the body of the const. r? `@oli-obk`
2025-06-07Rollup merge of #140560 - Urgau:test_attr-module-level, r=GuillaumeGomezGuillaume Gomez-0/+382
Allow `#![doc(test(attr(..)))]` everywhere This PR adds the ability to specify [`#![doc(test(attr(..)))]`](https://doc.rust-lang.org/nightly/rustdoc/write-documentation/the-doc-attribute.html#testattr) ~~at module level~~ everywhere in addition to allowing it at crate-root. This is motivated by a recent PR #140323 (by ````@tgross35)```` where we have to duplicate 2 attributes to every single `f16` and `f128` doctests, by allowing `#![doc(test(attr(..)))]` at module level (and everywhere else) we can omit them entirely and just have (in both module): ```rust #![doc(test(attr(feature(cfg_target_has_reliable_f16_f128))))] #![doc(test(attr(expect(internal_features))))] ``` Those new attributes are appended to the one found at crate-root or at a previous module. Those "global" attributes are compatible with merged doctests (they already were before). Given the small addition that this is, I'm proposing to insta-stabilize it, but I can feature-gate it if preferred. Best reviewed commit by commit. r? ````@GuillaumeGomez````
2025-06-07const-eval error: always say in which item the error occurredRalf Jung-1/+1
also adjust the wording a little so that we don't say "the error occurred here" for two different spans
2025-06-03Rollup merge of #141698 - oli-obk:ctfe-err-flip, r=RalfJungMatthias Krüger-4/+4
Use the informative error as the main const eval error message r? `@RalfJung` I only did the minimal changes necessary to the const eval error machinery. I'd prefer not to mix test changes with refactorings 😆
2025-06-02Clarify why we are talking about a failed const eval at a random placeOli Scherer-1/+1
2025-06-02Use the informative error as the main const eval error messageOli Scherer-4/+4