about summary refs log tree commit diff
path: root/src/test/rustdoc-ui
AgeCommit message (Collapse)AuthorLines
2020-07-15Catch errors for any new item, not just trait implementationsJoshua Nelson-3/+9
This matches the previous behavior of everybody_loops and is also more consistent than special-casing impls.
2020-07-15Don't ICE on infinitely recursive typesJoshua Nelson-0/+21
`evaluate_obligation` can only be run on types that are already valid. So rustdoc still has to run typeck even though it doesn't care about the result.
2020-07-15--blessJoshua Nelson-6/+18
2020-07-15Don't crash on Vec<DoesNotExist>Joshua Nelson-0/+7
2020-07-15Recurse into function bodies, but don't typeck closuresJoshua Nelson-67/+126
Previously, rustdoc would issue a delay_span_bug ICE on the following code: ```rust pub fn a() -> impl Fn() -> u32 { || content::doesnt::matter() } ``` This wasn't picked up earlier because having `type Alias = impl Trait;` in the same module caused _all closures_ to be typechecked, even if they wouldn't normally. Additionally, if _any_ error was emitted, no delay_span_bug would be emitted. So as part of this commit all of the tests were separated out into different files.
2020-07-15Don't ICE on errors in function returning impl traitJoshua Nelson-0/+67
Instead, report the error. This emits the errors on-demand, without special-casing `impl Trait`, so it should catch all ICEs of this kind, including ones that haven't been found yet. Since the error is emitted during type-checking there is less info about the error; see comments in the code for details. - Add test case for -> impl Trait - Add test for impl trait with alias - Move EmitIgnoredResolutionErrors to rustdoc This makes `fn typeck_item_bodies` public, which is not desired behavior. That change should be removed once https://github.com/rust-lang/rust/pull/74070 is merged. - Don't visit nested closures twice
2020-07-15Add an option not to report resolution errors for rustdocJoshua Nelson-0/+109
- Remove unnecessary `should_loop` variable - Report errors for trait implementations These should give resolution errors because they are visible outside the current scope. Without these errors, rustdoc will give ICEs: ``` thread 'rustc' panicked at 'attempted .def_id() on invalid res: Err', /home/joshua/src/rust/src/libstd/macros.rs:16:9 15: rustc_hir::def::Res<Id>::def_id at /home/joshua/src/rust/src/librustc_hir/def.rs:382 16: rustdoc::clean::utils::register_res at src/librustdoc/clean/utils.rs:627 17: rustdoc::clean::utils::resolve_type at src/librustdoc/clean/utils.rs:587 ``` - Add much more extensive tests + fn -> impl -> fn + fn -> impl -> fn -> macro + errors in function parameters + errors in trait bounds + errors in the type implementing the trait + unknown bounds for the type + unknown types in function bodies + errors generated by macros - Use explicit state instead of trying to reconstruct it from random info - Use an enum instead of a boolean - Add example of ignored error
2020-07-13Rollup merge of #74147 - dennis-hamester:fix/issue-74134, r=jyn514Manish Goregaokar-0/+51
rustdoc: Allow linking from private items to private types Fixes #74134 After PR #72771 this would trigger an intra_doc_link_resolution_failure warning when rustdoc is invoked without --document-private-items. Links from private items to private types are however never actually generated in that case and thus shouldn't produce a warning. These links are in fact a very useful tool to document crate internals. Tests are added for all 4 combinations of public/private items and link targets. Test 1 is the case mentioned above and fails without this commit. Tests 2 - 4 passed before already but are added nonetheless to prevent regressions.
2020-07-11test: rustdoc-ui: issue-74134: Shorten a too long lineDennis Hamester-1/+1
2020-07-11test: rustdoc-ui: Expand issue-74134 to cover types in a private moduleDennis Hamester-0/+15
2020-07-11test: rustdoc-ui: Add issue-74134, replacing test/rustdoc/issue-74134-*Dennis Hamester-0/+36
As per the discussion in PR #74147, the 4 individual tests are replaced by a single one. The test is expanded to cover all 4 public/private cases, each with and without --document-private-items.
2020-07-08Move #[doc(alias)] check in rustcGuillaume Gomez-29/+0
2020-07-07rustdoc: Rename invalid_codeblock_attribute lint to be pluralOliver Middleton-6/+6
2020-06-28use outermost invocation span for doctest namesAndy Russell-4/+24
Fixes #70090.
2020-06-26Generate docs for links to private items when passed --document-privateJoshua Nelson-0/+36
- Pass around document_private a lot more - Add tests + Add tests for intra-doc links to private items + Add ignored tests for warnings in reference links
2020-06-23Rollup merge of #72780 - GuillaumeGomez:enforce-doc-alias-check, r=ollie27Manish Goregaokar-0/+29
Enforce doc alias check Part of #50146. r? @ollie27
2020-06-21Update UI testsGuillaume Gomez-2/+4
2020-05-30Add test for doc alias attribute validationGuillaume Gomez-0/+29
2020-05-15remove extra space from crate-level doctest namesAndy Russell-0/+22
2020-04-24Add rustdoc regression test for the unused_braces lintflip1995-0/+14
2020-04-23Rollup merge of #71408 - GuillaumeGomez:check-code-blocks-tags, r=kinnisonDylan DPC-0/+493
Check code blocks tags Fixes #71347. Explanations here: I realized recently that it was a common issue to confuse/misspell tags on code blocks. This is actually quite a big issue since it generally ends up in a code blocks being ignored since it's not being considered as a rust one. With this new warning, users will at least be notified about it. PS: some improvements can be done on the error rendering but considering how big the PR already is, I think it's better to do it afterwards. r? @ollie27 cc @rust-lang/rustdoc
2020-04-23Add UI tests for new rustdoc lintGuillaume Gomez-0/+493
2020-04-19Moving all rustdoc-ui tests to check-passVal Markovic-19/+19
These were all build-pass before and don't seem to need it. Helps with #62277
2020-04-11rustc: Add a warning count upon completionRoccoDev-0/+8
2020-03-28Auto merge of #66938 - GuillaumeGomez:lint-for-no-crate-level-doc, r=Dylan-DPCbors-0/+15
Add lint when no doc is present at the crate-level Follow-up of #66267. r? @kinnison
2020-03-22fix one more testmark-1/+1
2020-03-22Update lint name to follow conventionGuillaume Gomez-3/+3
2020-03-22Update testsGuillaume Gomez-8/+7
2020-03-22Add lint when no doc is present at the crate-levelGuillaume Gomez-0/+16
2020-03-14resolve: Fix regression in resolution of raw keywords in pathsVadim Petrochenkov-5/+5
2020-03-02remove output-format testGuillaume Gomez-10/+0
2020-03-02Replace ToJson with serdeGuillaume Gomez-8/+18
2020-03-02add tests for rustdoc output-format jsonGuillaume Gomez-0/+34
2020-02-09--bless --compare-mode=nllMatthias Prechtl-2/+2
2020-02-06rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros.Eduard-Mihai Burtescu-0/+1
2020-01-24Normalise notes with the/isvarkor-13/+13
2020-01-20Rollup merge of #68357 - ollie27:rustdoc_test_errors, r=GuillaumeGomezDylan DPC-0/+62
rustdoc: Fix handling of compile errors when running `rustdoc --test` * Call `abort_if_errors` so all errors actually stop rustdoc. * Don't panic with "compiler aborted in rustdoc!", instead just exit to avoid the ugly panic message. * Use rlib as the crate type when searching for doctests matching what is used for doc generation so `#[no_std]` crates don't create "no global memory allocator" errors. Fixes #52243 Fixes #54010 r? @GuillaumeGomez
2020-01-18rustdoc: Fix handling of compile errors when running `rustdoc --test`Oliver Middleton-0/+62
* Call `abort_if_errors` so all errors actually stop rustdoc. * Don't panic with "compiler aborted in rustdoc!", instead just exit to avoid the ugly panic message. * Use rlib as the crate type when searching for doctests matching what is used for doc generation so `#[no_std]` crates don't create "no global memory allocator" errors.
2020-01-17rustdoc: Catch fatal errors when syntax highlightingOliver Middleton-0/+21
For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.
2020-01-12Update `output-default.json` and rustdoc testvarkor-1/+1
2020-01-04buffer lexer errors in rustdoc syntax checkingAndy Russell-109/+19
2019-12-04rustdoc: Add test for fixed issueOliver Middleton-0/+15
2019-11-27Auto merge of #66675 - GuillaumeGomez:support-anchors-intra-doc-links, ↵bors-28/+105
r=kinnison Support anchors intra doc links Fixes #62833 Part of #43466. cc @ollie27 r? @kinnison
2019-11-26Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPCTyler Mandry-16/+16
Various tweaks to diagnostic output
2019-11-25Update error messagesGuillaume Gomez-36/+36
2019-11-24Fix some rustdoc error capitalizationEsteban Küber-16/+16
2019-11-23Add test for anchorsGuillaume Gomez-0/+77
2019-11-21Point at type in `let` assignment on type errorsEsteban Küber-1/+3
2019-11-18Surround types with backticks in type errorsEsteban Küber-1/+1
2019-11-18Remove E0308 note when primary label has all infoEsteban Küber-3/+0