about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2019-04-26Rollup merge of #59940 - GuillaumeGomez:rustdoc-test, r=ollie27Mazdak Farrokhzad-0/+25
Set cfg(test) when rustdoc is running with --test option Following a [discussion on twitter](https://twitter.com/burntsushi5/status/1117091914199785473), I proposed this change. What do you think about it? r? @QuietMisdreavus cc @BurntSushi
2019-04-24Add test for rustdoc cfg(test) featureGuillaume Gomez-0/+25
2019-04-23Remove unnecessary tidy ignore directivesvarkor-4/+2
2019-03-25compiletest: make path normalization smarterAndy Russell-41/+41
2019-03-15use `!` in macro disambiguation suggestionAndy Russell-3/+3
2019-03-15replace ad-hoc namespace enumsAndy Russell-5/+5
2019-03-15overhaul intra-doc-link ambiguity warningAndy Russell-0/+118
- Makes the warning part of the `intra_doc_link_resolution_failure` lint. - Tightens the span to just the ambiguous link. - Reports ambiguities across all three namespaces. - Uses structured suggestions for disambiguation. - Adds a test for the warnings.
2019-03-11Update testsVadim Petrochenkov-7/+7
2019-03-10Make the rustc driver and interface demand drivenJohn Kåre Alsaker-4/+19
2019-03-09Rollup merge of #58626 - QuietMisdreavus:doc-coverage, r=GuillaumeGomezMazdak Farrokhzad-0/+222
rustdoc: add option to calculate "documentation coverage" This PR adds a new flag to rustdoc, `--show-coverage`. When passed, this flag will make rustdoc count the number of items in a crate with documentation instead of generating docs. This count will be output as a table of each file in the crate, like this (when run on my crate `egg-mode`): ``` +-------------------------------------+------------+------------+------------+ | File | Documented | Total | Percentage | +-------------------------------------+------------+------------+------------+ | src/auth.rs | 16 | 16 | 100.0% | | src/common/mod.rs | 1 | 1 | 100.0% | | src/common/response.rs | 9 | 9 | 100.0% | | src/cursor.rs | 24 | 24 | 100.0% | | src/direct/fun.rs | 6 | 6 | 100.0% | | src/direct/mod.rs | 41 | 41 | 100.0% | | src/entities.rs | 50 | 50 | 100.0% | | src/error.rs | 27 | 27 | 100.0% | | src/lib.rs | 1 | 1 | 100.0% | | src/list/fun.rs | 19 | 19 | 100.0% | | src/list/mod.rs | 22 | 22 | 100.0% | | src/media/mod.rs | 27 | 27 | 100.0% | | src/place/fun.rs | 8 | 8 | 100.0% | | src/place/mod.rs | 35 | 35 | 100.0% | | src/search.rs | 26 | 26 | 100.0% | | src/service.rs | 74 | 74 | 100.0% | | src/stream/mod.rs | 49 | 49 | 100.0% | | src/tweet/fun.rs | 15 | 15 | 100.0% | | src/tweet/mod.rs | 73 | 73 | 100.0% | | src/user/fun.rs | 24 | 24 | 100.0% | | src/user/mod.rs | 87 | 87 | 100.0% | +-------------------------------------+------------+------------+------------+ | Total | 634 | 634 | 100.0% | +-------------------------------------+------------+------------+------------+ ``` Trait implementations are not counted because by default they "inherit" the docs from the trait, even though an impl can override those docs. Similarly, inherent impl blocks are not counted at all, because for the majority of cases such docs are not useful. (The usual pattern for inherent impl blocks is to throw all the methods on a type into a single impl block. Any docs you would put on that block would be better served on the type itself.) In addition, `--show-coverage` can be combined with `--document-private-items` to get the coverage counts for everything in the crate, not just public items. The coverage calculation is implemented as a late pass and two new sets of passes which strip out most of the work that rustdoc otherwise does when generating docs. The is because after the new pass is executed, rustdoc immediately closes instead of going on to generate documentation. Many examples of coverage calculations have been included as `rustdoc-ui` tests. r? @rust-lang/rustdoc
2019-02-28update rustdoc coverage tests with new table layoutQuietMisdreavus-80/+51
2019-02-28add tests for doc coverageQuietMisdreavus-0/+251
2019-02-28Introduce rustc_interface and move some methods thereJohn Kåre Alsaker-2/+2
2019-02-23move collapse and unindent docs passes earlierAndy Russell-2/+24
2019-02-19Auto merge of #56514 - ollie27:rustdoc_test_libdir, r=QuietMisdreavusbors-2/+2
rustdoc: Don't modify library path for doctests It shouldn't be needed anymore because doctests are no longer compiled with `prefer-dynamic` (since #54939). r? @QuietMisdreavus
2019-01-20Auto merge of #56884 - euclio:codeblock-diagnostics, r=QuietMisdreavusbors-10/+156
rustdoc: overhaul code block lexing errors Fixes #53919. This PR moves the reporting of code block lexing errors from rendering time to an early pass, so we can use the compiler's error reporting mechanisms. This dramatically improves the diagnostics in this situation: we now de-emphasize the lexing errors as a note under a warning that has a span and suggestion instead of just emitting errors at the top level. Additionally, this PR generalizes the markdown -> source span calculation function, which should allow other rustdoc warnings to use better spans in the future. Last, the PR makes sure that the code block is always emitted in the docs, even if it fails to highlight correctly. Of note: - The new pass unfortunately adds another pass over the docs to gather the doc blocks for syntax-checking. I wonder if this could be combined with the pass that looks for testable blocks? I'm not familiar with that code, so I don't know how feasible that is. - `pulldown_cmark` doesn't make it easy to find the spans of the code blocks, so the code that calculates the spans is a little nasty. It works for all the test cases I threw at it, but I wouldn't be surprised if an edge case would break it. Should have a thorough review. - This PR worsens the state of #56885, since those certain fatal lexing errors are now emitted before docs get generated at all.
2019-01-20rustdoc: Don't modify library path for doctestsOliver Middleton-2/+2
It shouldn't be needed anymore because doctests are no longer compiled with `prefer-dynamic`.
2019-01-17Bless test.Wesley Norris-2/+2
Bless test, remove submodule, and fix book entry. bless test again? maybe it'll work this time...
2019-01-17Minor changes to wording and formatting.Wesley Norris-3/+2
2019-01-17Bless test.Wesley Norris-2/+3
2019-01-17Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrumbors-25/+5
Add lint for copyright headers to 'tidy' tool r? @Mark-Simulacrum CC @centril
2019-01-14rustdoc: check code block syntax in early passAndy Russell-10/+156
2019-01-13Removed more copyright notices.Alexander Regueiro-25/+5
2019-01-13Account for 2 removed lines in src/librustdoc/test.rsIgor Matuszewski-2/+2
2019-01-06check missing docs for reexported macros as wellGuillaume Gomez-0/+67
2019-01-02make `panictry!` private to libsyntaxAndy Russell-2/+2
This commit completely removes usage of the `panictry!` macro from outside libsyntax. The macro causes parse errors to be fatal, so using it in libsyntax_ext caused parse failures *within* a syntax extension to be fatal, which is probably not intended. Furthermore, this commit adds spans to diagnostics emitted by empty extensions if they were missing, à la #56491.
2018-12-25Remove licensesMark Rousskov-156/+47
2018-12-19Rollup merge of #56689 - QuietMisdreavus:rustdoc-lint-group, r=pnkfelixPietro Albini-0/+78
add a lint group for lints emitted by rustdoc As rustdoc adds more lints that it specifically manages, it would be nice to be able to lump them all together. This gives us a new group just for that. I deliberately didn't include `missing_docs` because this is kind of a stepping stone for moving our lints into tool lints (i.e. `#![warn(rustdoc::private_doc_tests)]`), since all of these are specifically emitted by rustdoc. If we want to move `missing_docs` out of the compiler, that's also an option, but it would create a surprising change of behavior. I also took the chance to rewrite the lint descriptions of these lints to better match the style of the other lints. `>_>`
2018-12-14Rollup merge of #56748 - kinnison:kinnison/fix-56734, r=dtolnaykennytm-2/+2
Update panic message to be clearer about env-vars Esteban Kuber requested that the panic message make it clear that `RUST_BACKTRACE=1` is an environment variable. This change makes that clear. I understand that this may simply be closed if the concept isn't accepted, and I'd be fine with that :-) Fixes #56734
2018-12-13Update panic message to be clearer about env-varsDaniel Silverstone-2/+2
Esteban Kuber requested that the panic message make it clear that `RUST_BACKTRACE=1` is an environment variable. This change makes that clear. Wording provided in part by David Tolnay.
2018-12-10fix intra-link resolution spans in block commentsAndy Russell-24/+163
This commit improves the calculation of code spans for intra-doc resolution failures. All sugared doc comments should now have the correct spans, including those where the comment is longer than the docs. It also fixes an issue where the spans were calculated incorrectly for certain unsugared doc comments. The diagnostic will now always use the span of the attributes, as originally intended. Fixes #55964.
2018-12-10add a lint group for lints emitted by rustdocQuietMisdreavus-0/+78
2018-12-07Fixed line numbers in stderr file.Alexander Regueiro-2/+2
2018-12-04adds DocTest filename variant, refactors doctest_offset out of source_map, ↵Matthew Russo-2/+2
fixes remaining test failures
2018-12-04Update doc-ui testsOliver Scherer-5/+11
2018-11-22Auto merge of #53586 - eddyb:top-lock, r=alexcrichtonbors-2/+2
Move Cargo.{toml,lock} to the repository root directory. This should give us back `src/` in errors, panics and debuginfo, for free. r? @Mark-Simulacrum @alexcrichton cc @michaelwoerister
2018-11-22Move Cargo.{toml,lock} to the repository root directory.Eduard-Mihai Burtescu-2/+2
2018-11-22Rollup merge of #55367 - GuillaumeGomez:private-item-doc-test-lint, ↵Guillaume Gomez-0/+36
r=QuietMisdreavus lint if a private item has doctests Fixes #55333. r? @QuietMisdreavus
2018-11-16lint if a private item has doctestsGuillaume Gomez-0/+36
2018-11-14properly calculate spans for intra-doc link resolution errorsQuietMisdreavus-0/+37
2018-11-02update rustdoc-ui/failed-doctest-output testQuietMisdreavus-2/+2
2018-10-23Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rsJosh Stone-9/+10
This UI test is sensitive to backtrace output, so it should make sure that backtraces are not enabled by the environment.
2018-10-18Auto merge of #54349 - GuillaumeGomez:no-example-lint, r=QuietMisdreavusbors-0/+46
[rustdoc] Add lint for doc without codeblocks Fixes #53805. r? @QuietMisdreavus
2018-10-17Auto merge of #54939 - ↵bors-2/+2
pnkfelix:issue-54478-dont-prefer-dynamic-in-doc-tests, r=QuietMisdreavus rustdoc: don't prefer dynamic linking in doc tests This is an attempt to address the regression in #54478 This may be a case where the cure is worse than the disease, at least in the short term... cc @alexcrichton
2018-10-12Auto merge of #53933 - GuillaumeGomez:codeblock-error-display, r=QuietMisdreavusbors-0/+27
Improve error display for codeblocks in rustdoc Part of #53919. r? @QuietMisdreavus
2018-10-09Update a rustdoc ui test whose output has changedAlex Crichton-2/+2
2018-10-09Add test for docs without examplesGuillaume Gomez-0/+46
2018-09-29Add a sentence before rustc errorsGuillaume Gomez-0/+1
2018-09-29Improve error display for codeblocks in rustdocGuillaume Gomez-0/+26
2018-09-19add -Zui-testing to rustdocQuietMisdreavus-31/+31