Commit graph

144 commits

Author SHA1 Message Date
Manish Goregaokar
e4a9b36126
Rollup merge of #74147 - dennis-hamester:fix/issue-74134, r=jyn514
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-13 22:23:11 -07:00
Dennis Hamester
87895251ea test: rustdoc-ui: issue-74134: Shorten a too long line 2020-07-11 10:31:27 +02:00
Dennis Hamester
97048595e1 test: rustdoc-ui: Expand issue-74134 to cover types in a private module 2020-07-11 10:02:18 +02:00
Dennis Hamester
689e360d82 test: rustdoc-ui: Add issue-74134, replacing test/rustdoc/issue-74134-*
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-11 09:26:26 +02:00
Oliver Middleton
56fb71786a rustdoc: Rename invalid_codeblock_attribute lint to be plural 2020-07-07 18:29:26 +01:00
Joshua Nelson
20552c811a Generate docs for links to private items when passed --document-private
- 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-26 07:23:39 -04:00
Manish Goregaokar
7d2fba1bd2
Rollup merge of #72780 - GuillaumeGomez:enforce-doc-alias-check, r=ollie27
Enforce doc alias check

Part of #50146.

r? @ollie27
2020-06-23 13:09:59 -07:00
Guillaume Gomez
c14d85fd33 Update UI tests 2020-06-21 16:40:36 +02:00
Guillaume Gomez
2d6267a7a8 Add test for doc alias attribute validation 2020-05-30 15:36:57 +02:00
Andy Russell
c379fb5b3a
remove extra space from crate-level doctest names 2020-05-15 23:56:23 -04:00
flip1995
485f1999f5
Add rustdoc regression test for the unused_braces lint 2020-04-24 19:15:07 +02:00
Dylan DPC
0959802a57
Rollup merge of #71408 - GuillaumeGomez:check-code-blocks-tags, r=kinnison
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-23 20:35:01 +02:00
Guillaume Gomez
96a352ebd3 Add UI tests for new rustdoc lint 2020-04-23 16:18:50 +02:00
Val Markovic
2add9d8fc2 Moving all rustdoc-ui tests to check-pass
These were all build-pass before and don't seem to need it.

Helps with #62277
2020-04-19 16:40:53 -07:00
RoccoDev
b85c64c3ea
rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
bors
77621317d6 Auto merge of #66938 - GuillaumeGomez:lint-for-no-crate-level-doc, r=Dylan-DPC
Add lint when no doc is present at the crate-level

Follow-up of #66267.

r? @kinnison
2020-03-28 20:11:01 +00:00
mark
5e8b795552 fix one more test 2020-03-22 17:18:30 -05:00
Guillaume Gomez
be97eb4ece Update lint name to follow convention 2020-03-22 13:04:23 +01:00
Guillaume Gomez
ffe1289fd2 Update tests 2020-03-22 13:01:42 +01:00
Guillaume Gomez
12607ef569 Add lint when no doc is present at the crate-level 2020-03-22 13:01:42 +01:00
Vadim Petrochenkov
e80cb2032c resolve: Fix regression in resolution of raw keywords in paths 2020-03-14 19:21:38 +03:00
Guillaume Gomez
b6466273ba remove output-format test 2020-03-02 13:20:32 +01:00
Guillaume Gomez
f1070b1525 Replace ToJson with serde 2020-03-02 13:19:10 +01:00
Guillaume Gomez
15babed8b7 add tests for rustdoc output-format json 2020-03-02 13:18:45 +01:00
Matthias Prechtl
7b555178ae --bless --compare-mode=nll 2020-02-09 20:43:49 +01:00
Eduard-Mihai Burtescu
4c7eb59e81 rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
varkor
24a2929ed1 Normalise notes with the/is 2020-01-24 16:24:50 +00:00
Dylan DPC
cd4652a195
Rollup merge of #68357 - ollie27:rustdoc_test_errors, r=GuillaumeGomez
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-20 11:14:49 +05:30
Oliver Middleton
17f4cbc303 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.
2020-01-18 23:51:06 +00:00
Oliver Middleton
79061d0e02 rustdoc: Catch fatal errors when syntax highlighting
For some errors the lexer will unwind so we need to handle that in addition to handling `token::Unknown`.
2020-01-17 23:44:44 +00:00
varkor
1faa05daac Update output-default.json and rustdoc test 2020-01-12 15:37:50 +00:00
Andy Russell
1ad928ee52
buffer lexer errors in rustdoc syntax checking 2020-01-04 19:20:35 -05:00
Oliver Middleton
b6b0fd9148 rustdoc: Add test for fixed issue 2019-12-04 01:31:35 +00:00
bors
b5f265eeed Auto merge of #66675 - GuillaumeGomez:support-anchors-intra-doc-links, r=kinnison
Support anchors intra doc links

Fixes #62833
Part of #43466.

cc @ollie27
r? @kinnison
2019-11-27 04:51:31 +00:00
Tyler Mandry
bb6236cd74
Rollup merge of #66754 - estebank:rustdoc-capitalization, r=Dylan-DPC
Various tweaks to diagnostic output
2019-11-26 17:56:19 -06:00
Guillaume Gomez
c1ea1fd2b0 Update error messages 2019-11-25 14:24:53 +01:00
Esteban Küber
e5816a75cc Fix some rustdoc error capitalization 2019-11-24 18:42:22 -08:00
Guillaume Gomez
433f2b030b Add test for anchors 2019-11-23 18:46:07 +01:00
Esteban Küber
34f03c01f6 Point at type in let assignment on type errors 2019-11-21 19:24:31 -08:00
Esteban Küber
6f8f70624b Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
Esteban Küber
94c6425464 Remove E0308 note when primary label has all info 2019-11-18 11:03:03 -08:00
Yuki Okushi
6eea5001b5
Rollup merge of #66166 - GuillaumeGomez:rename-rustdoc-to-doc, r=QuietMisdreavus
rename cfg(rustdoc) into cfg(doc)

Needed by https://github.com/rust-lang/rust/pull/61351

r? @QuietMisdreavus
2019-11-13 22:09:13 +09:00
Tomasz Miąsko
70b146c2cb Add warning annotations to rustdoc-ui tests 2019-11-10 21:01:02 +01:00
Guillaume Gomez
0282c27781 rename cfg(rustdoc) into cfg(doc) 2019-11-06 18:32:51 +01:00
Andy Russell
d06a4ded13
use silent emitter for rustdoc highlighting pass 2019-11-03 22:19:34 -05:00
Guillaume Gomez
a212960a4b stabilize cfg(doctest) 2019-10-29 13:42:55 +01:00
Esteban Küber
0baf61bfdb Increase spacing for suggestions in diagnostics
Make the spacing between the code snippet and verbose structured
suggestions consistent with note and help messages.
2019-10-24 12:26:01 -07:00
Mazdak Farrokhzad
194d1935d3
Rollup merge of #65314 - tmiasko:rustdoc-z, r=ollie27
rustdoc: forward -Z options to rustc

Currently rustdoc does not forward `-Z` options to rustc when building
test executables. This makes impossible to use rustdoc to run test
samples when crate under test is instrumented with one of sanitizers
`-Zsanitizer=...`, since the final linking step will not include
sanitizer runtime library.

Forward `-Z` options to rustc to solve the issue.

Helps with #43031.
2019-10-21 01:39:11 +02:00
Tomasz Miąsko
5db17335a1 rustdoc: forward -Z options to rustc
Currently rustdoc does not forward `-Z` options to rustc when building
test executables. This makes impossible to use rustdoc to run test
samples when crate under test is instrumented with one of sanitizers
`-Zsanitizer=...`, since the final linking step will not include
sanitizer runtime library.

Forward `-Z` options to rustc to solve the issue.

Helps with #43031.
2019-10-11 22:29:11 +02:00
Guillaume Gomez
3e376f5c1f Add and update rustdoc ui test 2019-10-10 11:37:13 +02:00