summary refs log tree commit diff
path: root/src/test/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2021-03-10[intra-doc links] Don't check feature gates of items re-exported across cratesJoshua Nelson-0/+8
It should be never break another crate to re-export a public item. Note that this doesn't check the feature gate at *all* for other crates: - Feature-gates aren't currently serialized, so the only way to check the gate is with ad-hoc attribute checking. - Checking the feature gate twice (once when documenting the original crate and one when documenting the current crate) seems not great. This should still catch using the feature most of the time though, since people tend to document their own crates. (cherry picked from commit fdb32e997bef725f538f66dcfd96b1c1e51d2c56)
2021-02-04Add a test for the shortness format in rustdocAlexis Bourget-0/+28
2021-01-30Balance sidebar `Deref` cycle check with main contentJ. Ryan Stinnett-0/+15
The `Deref` cycle checks added as part of #80653 were "unbalanced" in the sense that the main content code path checks for cycles _before_ descending, while the sidebar checks _after_. Checking _before_ is correct, so this changes the sidebar path to match the main content path.
2021-01-23Add option to control doctest run directoryArpad Borsos-0/+35
This option will allow splitting the compile-time from the run-time directory of doctest invocations and is one step to solve https://github.com/rust-lang/cargo/issues/8993#issuecomment-760088944
2021-01-17Feature-gate `pointer` and `reference` in intra-doc linksJoshua Nelson-9/+39
- Only feature gate associated items - Add docs to unstable book
2021-01-16Add a testÖmer Sinan Ağacan-0/+17
2021-01-13Update tests for extern block lintingMark Rousskov-3/+5
2021-01-08Auto merge of #80653 - jryans:doc-deref-recursive, r=jyn514,GuillaumeGomezbors-0/+17
Recursively document methods via `Deref` traits This changes `rustdoc` to recursively follow `Deref` targets so that methods from all levels are added to the rendered output. This implementation displays the methods from all levels in the expanded state with separate sections for each level. ![image](https://user-images.githubusercontent.com/279572/103482863-46723b00-4ddb-11eb-972b-c463351a425c.png) Fixes https://github.com/rust-lang/rust/issues/26207 Fixes https://github.com/rust-lang/rust/issues/53038 Fixes https://github.com/rust-lang/rust/issues/71640 r? `@jyn514`
2021-01-08Recursively document methods via `Deref` traitsJ. Ryan Stinnett-0/+17
2021-01-08Rollup merge of #80799 - jyn514:pretty-print, r=CraftSpiderYuki Okushi-0/+3
Get rid of custom pretty-printing in rustdoc and use rustc_hir_pretty directly instead. Closes https://github.com/rust-lang/rust/issues/79497. r? `@CraftSpider`
2021-01-08Rollup merge of #80372 - jyn514:fix-panics, r=ManishearthYuki Okushi-0/+20
Don't panic when an external crate can't be resolved This isn't actually a bug, it can occur when rustdoc tries to resolve a crate that isn't used in the main code. Fixes #72381. r? `@kinnison` if you have time, otherwise `@Manishearth`
2021-01-07Get rid of custom pretty-printing in rustdocJoshua Nelson-0/+3
and use rustc_hir_pretty directly instead
2021-01-08Rollup merge of #80660 - max-heller:issue-80559-fix, r=jyn514Yuki Okushi-0/+18
Properly handle primitive disambiguators in rustdoc Fixes #80559 r? ``@jyn514`` Is there a way to test that the generated intra-doc link is what I expect?
2021-01-05Remove useless doc_alias featureGuillaume Gomez-4/+2
2021-01-04fix incompatible disambiguator testmax-heller-0/+18
2021-01-04Add tests for new doc alias checkGuillaume Gomez-0/+12
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