about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2021-01-03Auto merge of #77859 - bugadani:no-duplicate-ref-link-error, r=jyn514bors-8/+84
Rustdoc: only report broken ref-style links once This PR assigns the markdown `LinkType` to each parsed link and passes this information into the link collector. If a link can't be resolved in `resolve_with_disambiguator`, the failure is cached for the link types where we only want to report the error once (namely `Shortcut` and `Reference`). Fixes #77681
2021-01-03Only report reference-style link errors onceDániel Buga-8/+84
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-01-03Rollup merge of #80580 - GuillaumeGomez:suggestion-ignore-codeblock-warn, ↵Guillaume Gomez-0/+24
r=jyn514 Add suggestion for "ignore" doc code block Part of https://github.com/rust-lang/rust/issues/30032. This PR adds a suggestion to help users when they have a "ignore" doc code block which is invalid rust code. r? `@jyn514`
2021-01-02Update rustdoc-ui test outputGuillaume Gomez-2/+4
2021-01-01Add test for suggestion in case a "ignore" doc block has invalid rust code ↵Guillaume Gomez-0/+24
inside
2020-12-31Auto merge of #80267 - 0urobor0s:ouro/61592, r=jyn514bors-0/+44
Rustdoc render public underscore_imports as Re-exports Fixes #61592
2020-12-31Rustdoc render public underscore_imports as Re-exportsbors-0/+44
Fixes #61592
2020-12-30Rollup merge of #80381 - rust-lang:revert-80244-spans, r=GuillaumeGomezYuki Okushi-0/+27
Revert "Cleanup markdown span handling" Reverts rust-lang/rust#80244. This caused a diagnostic regression, originally it was: ``` warning: unresolved link to `std::process::Comman` --> link.rs:3:10 | 3 | //! [a]: std::process::Comman | ^^^^^^^^^^^^^^^^^^^^ no item named `Comman` in module `process` | = note: `#[warn(broken_intra_doc_links)]` on by default ``` but after that PR rustdoc now displays ``` warning: unresolved link to `std::process::Comman` --> link.rs:1:14 | 1 | //! Links to [a] [link][a] | ^^^ no item named `Comman` in module `process` | = note: `#[warn(broken_intra_doc_links)]` on by default ``` which IMO is much less clear. cc `@bugadani,` thanks for catching this in https://github.com/rust-lang/rust/pull/77859. r? `@GuillaumeGomez`
2020-12-27Auto merge of #80181 - jyn514:intra-doc-primitives, r=Manishearthbors-0/+103
Fix intra-doc links for non-path primitives This does *not* currently work for associated items that are auto-implemented by the compiler (e.g. `never::eq`), because they aren't present in the source code. I plan to fix this in a follow-up PR. Fixes https://github.com/rust-lang/rust/issues/63351 using the approach mentioned in https://github.com/rust-lang/rust/issues/63351#issuecomment-683352130. r? `@Manishearth` cc `@petrochenkov` - this makes `rustc_resolve::Res` public, is that ok? I'd just add an identical type alias in rustdoc if not, which seems a waste.
2020-12-26update testsBastian Kauschke-1/+0
2020-12-26Revert "Cleanup markdown span handling"Joshua Nelson-0/+27
This caused a diagnostic regression, originally it was: ``` warning: unresolved link to `std::process::Comman` --> link.rs:3:10 | 3 | //! [a]: std::process::Comman | ^^^^^^^^^^^^^^^^^^^^ no item named `Comman` in module `process` | = note: `#[warn(broken_intra_doc_links)]` on by default ``` but after that PR rustdoc now displays ``` warning: unresolved link to `std::process::Comman` --> link.rs:1:14 | 1 | //! Links to [a] [link][a] | ^^^ no item named `Comman` in module `process` | = note: `#[warn(broken_intra_doc_links)]` on by default ``` which IMO is much less clear.
2020-12-25Don't panic when an external crate can't be resolvedJoshua Nelson-0/+20
This isn't actually a bug, it can occur when rustdoc tries to resolve a crate that isn't used in the main code.
2020-12-24Don't process `[]` and `()` in intra-doc linksJoshua Nelson-0/+103
These caused several false positives when documenting rustc, which means there will likely be many more false positives in the rest of the ecosystem.
2020-12-21Remove redundant testDániel Buga-16/+0
2020-12-02Add tests for #[doc(keyword = "...")] and update other doc attributes testsGuillaume Gomez-3/+3
2020-12-01Rollup merge of #79509 - GuillaumeGomez:improve-attr-spans, r=oli-obkGuillaume Gomez-14/+14
Improve attribute message error spans I got the idea while working on https://github.com/rust-lang/rust/pull/79464
2020-12-01Improve some attributes error spansGuillaume Gomez-14/+14
2020-12-01Rollup merge of #79527 - jyn514:intra-doc-tests, r=ManishearthMara Bos-97/+97
Move intra-doc link tests into a subdirectory They were starting to get unwieldy. r? ``@Manishearth``
2020-11-29Auto merge of #75752 - jakoschiko:test-suite-time, r=m-ou-sebors-39/+49
libtest: Print the total time taken to execute a test suite Print the total time taken to execute a test suite by default, without any kind of flag. Closes #75660 # Example ``` anon@anon:~/code/rust/example$ cargo test Compiling example v0.1.0 (/home/anon/code/rust/example) Finished test [unoptimized + debuginfo] target(s) in 0.18s Running target/debug/deps/example-745b64d3885c3565 running 3 tests test tests::foo ... ok test tests::bar ... ok test tests::baz ... ok test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; 1.2s Doc-tests example running 3 tests test src/lib.rs - foo (line 3) ... ok test src/lib.rs - bar (line 11) ... ok test src/lib.rs - baz (line 19) ... ok test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; 1.3s ``` ``` anon@anon:~/code/rust/example$ cargo test -- --format terse Finished test [unoptimized + debuginfo] target(s) in 0.08s Running target/debug/deps/example-745b64d3885c3565 running 3 tests ... test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; 1.2s Doc-tests example running 3 tests ... test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; 1.3s ``` ``` anon@anon:~/code/rust/example$ cargo test -- --format json -Z unstable-options Compiling example v0.1.0 (/home/anon/code/rust/example) Finished test [unoptimized + debuginfo] target(s) in 0.25s Running target/debug/deps/example-745b64d3885c3565 { "type": "suite", "event": "started", "test_count": 3 } { "type": "test", "event": "started", "name": "tests::bar" } { "type": "test", "event": "started", "name": "tests::baz" } { "type": "test", "event": "started", "name": "tests::foo" } { "type": "test", "name": "tests::foo", "event": "ok" } { "type": "test", "name": "tests::bar", "event": "ok" } { "type": "test", "name": "tests::baz", "event": "ok" } { "type": "suite", "event": "ok", "passed": 3, "failed": 0, "allowed_fail": 0, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": "1.2s" } Doc-tests example { "type": "suite", "event": "started", "test_count": 3 } { "type": "test", "event": "started", "name": "src/lib.rs - bar (line 11)" } { "type": "test", "event": "started", "name": "src/lib.rs - baz (line 19)" } { "type": "test", "event": "started", "name": "src/lib.rs - foo (line 3)" } { "type": "test", "name": "src/lib.rs - foo (line 3)", "event": "ok" } { "type": "test", "name": "src/lib.rs - bar (line 11)", "event": "ok" } { "type": "test", "name": "src/lib.rs - baz (line 19)", "event": "ok" } { "type": "suite", "event": "ok", "passed": 3, "failed": 0, "allowed_fail": 0, "ignored": 0, "measured": 0, "filtered_out": 0, "exec_time": "1.3s" } ```
2020-11-29Rollup merge of #79464 - GuillaumeGomez:doc-keyword-ident, r=jyn514Dylan DPC-0/+12
Extend doc keyword feature by allowing any ident Part of #51315. As suggested by ``@danielhenrymantilla`` in [this comment](https://github.com/rust-lang/rust/issues/51315#issuecomment-733879934), this PR extends `#[doc(keyword = "...")]` to allow any ident to be used as keyword. The final goal is to allow (proc-)macro crates' owners to write documentation of the keywords they might introduce. r? ``@jyn514``
2020-11-28Move `src/test/rustdoc-ui` intra-doc tests into a subdirectoryJoshua Nelson-97/+97
This also changes the builder to allow using `x.py test src/test/rustdoc-ui/intra-doc`; before, it would panic that no paths were found.
2020-11-27Add tests for doc_keyword feature extensionGuillaume Gomez-0/+12
2020-11-27libtest: Print the total time taken to execute a test suiteJakob Schikowski-39/+49
2020-11-26Update coverage output now that primitives have proper spansJoshua Nelson-2/+1
2020-11-26Rollup merge of #79412 - GuillaumeGomez:cleanup-rustdoc-tests, r=jyn514Jonas Schievink-22/+15
Clean up rustdoc tests by removing unnecessary features r? ``@jyn514``
2020-11-25Clean up rustdoc tests by removing unnecessary featuresGuillaume Gomez-22/+15
2020-11-24Get rid of doctree::FunctionJoshua Nelson-8/+8
2020-11-22Get rid of `doctree::Impl`Joshua Nelson-9/+9
2020-11-21x.py test --blessJoshua Nelson-93/+93
2020-11-16Add test to ensure that "invalid HTML tag" lint isn't fired in code blocksGuillaume Gomez-0/+21
2020-11-13Rollup merge of #78984 - GuillaumeGomez:rustdoc-check-option, r=jyn514Guillaume Gomez-0/+138
Rustdoc check option The ultimate goal behind this option would be to have `rustdoc --check` being run when you use `cargo check` as a second step. r? `@jyn514`
2020-11-12Ensure that INVALID_CODEBLOCK_ATTRIBUTES lint is emittedGuillaume Gomez-28/+47
2020-11-12Add tests for rustdoc --check optionGuillaume Gomez-0/+119
2020-11-11add error-in-impl-trait const generics testBastian Kauschke-0/+24
2020-11-05Rename lint to non_autolinksGuillaume Gomez-11/+11
2020-11-05Improve lint even moreGuillaume Gomez-0/+2
2020-11-05Don't check for URLs inside codeblocksGuillaume Gomez-20/+24
2020-11-05Rename automatic_links to url_improvementsGuillaume Gomez-4/+4
2020-11-05Improve automatic_links globallyGuillaume Gomez-3/+137
2020-11-05Extend automatic_links lint to take into account URLs without link syntaxGuillaume Gomez-9/+17
2020-11-05Add tests for automatic_links lintGuillaume Gomez-0/+40
2020-10-15Rollup merge of #77753 - GuillaumeGomez:check-html-comments, r=jyn514Yuki Okushi-1/+21
Check html comments Part of #67799. cc @ollie27 r? @jyn514
2020-10-15Rollup merge of #77570 - GuillaumeGomez:whitespace-doc-alias, r=jyn514,ollie27Yuki Okushi-8/+15
Allow ascii whitespace char for doc aliases Fixes issue from https://github.com/rust-lang/rust/issues/76705#issuecomment-703123847 cc @lopopolo @ollie27 r? @jyn514
2020-10-14Handle multi-line HTML commentsGuillaume Gomez-2/+6
2020-10-13Add check for HTML commentsGuillaume Gomez-1/+17
2020-10-13Auto merge of #76196 - r-52:r-coverage-allow-missing-docs, r=jyn514bors-0/+68
rustdoc: skip #[allow(missing docs)] for docs in coverage report During the document coverage reporting with: ```bash rustdoc something.rs -Z unstable-options --show-coverage ``` the coverage report counts code that is marked with `#[allow(missing_docs)]` for the calculation, which outputs lower numbers in the coverage report even though these parts should be ignored for the calculation. Right now I'm not sure how this can be tested (CI)? (I verified it by hand and ran the unit tests) r? `@jyn514` **Reference:** Fixes #76121
2020-10-12Extend test to ensure that items inherit lint level from the parentGuillaume Gomez-0/+2
2020-10-12Apply same treatment to MISSING_DOC_CODE_EXAMPLESGuillaume Gomez-0/+20
2020-10-12Inherit lint level from parentsGuillaume Gomez-2/+10
2020-10-12rustdoc: skip allow missing doc in cover. reportRoman-0/+38
During the document coverage reporting with ```bash rustdoc something.rs -Z unstable-options --show-coverage ``` the coverage report also includes parts of the code that are marked with `#[allow(missing_docs)]`, which outputs lower numbers in the coverage report even though these parts should be ignored for the calculation. Co-authored-by: Joshua Nelson <joshua@yottadb.com>