Commit graph

120 commits

Author SHA1 Message Date
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
Guillaume Gomez
169a1cac8d Don't pass doctest feature by default 2019-10-10 11:37:13 +02:00
Guillaume Gomez
366fdebff8 Add new rustdoc-ui test to ensuire that rustdoc feature isn't passed down to doctests 2019-10-01 14:38:36 +02:00
Eric Huss
fb387088e2 rustdoc: fix diagnostic with mixed code block styles 2019-09-07 12:21:32 -07:00
bors
59cc53e6e7 Auto merge of #63703 - tommilligan:warn-empty-doctest, r=ollie27
rustdoc: warn on empty doc test

Closes #60319.

A doc test that only contains whitespace should result in a warning.

This PR adds detection of empty doc tests to `check-code-block-syntax`, as having an invalid doc test is mutually exclusive with an empty doc test.
2019-08-31 20:10:20 +00:00
Aaron Hill
1498608135
Improve Rustdoc's handling of procedural macros
Fixes #58700
Fixes #58696
Fixes #49553
Fixes #52210

This commit removes the special rustdoc handling for proc macros, as we
can now
retrieve their span and attributes just like any other item.

A new command-line option is added to rustdoc: `--crate-type`. This
takes the same options as rustc's `--crate-type` option. However, all
values other than `proc-macro` are treated the same. This allows Rustdoc
to enable 'proc macro mode' when handling a proc macro crate.

In compiletest, a new 'rustdoc-flags' option is added. This allows us to
pass in the '--proc-macro-crate' flag in the absence of Cargo.

I've opened [an additional PR to
Cargo](https://github.com/rust-lang/cargo/pull/7159) to support passing
in this flag.
These two PRS can be merged in any order - the Cargo changes will not
take effect until the 'cargo' submodule is updated in this repository.
2019-08-24 13:11:57 -04:00
Tom Milligan
0ec2e9fceb
librustdoc: warn on empty doc test 2019-08-19 16:02:57 +01:00
Aleksey Kladov
b3e8c8bbe2 adapt rustdoc to infailable lexer 2019-08-05 13:15:12 +03:00
varkor
2777386dc2 Replace abstract type with type alias impl Trait 2019-08-02 02:44:36 +01:00
varkor
c28ce3e4ca Replace "existential" by "opaque" 2019-08-02 02:44:36 +01:00
Samy Kacimi
e5e1397adb
normalize use of backticks in compiler messages for librustc/lint
https://github.com/rust-lang/rust/issues/60532
2019-07-17 22:49:48 +02:00
QuietMisdreavus
cff6ce667f force single-threaded text execution 2019-07-06 21:41:11 -05:00
QuietMisdreavus
bed54cf854 rustdoc: set cfg(doctest) when collecting doctests 2019-07-06 21:37:17 -05:00
Yuki Okushi
c004451a20 Migrate compile-pass annotations to build-pass 2019-07-03 06:30:28 +09:00
Oliver Middleton
6c747e0303 Fix tests after revert of rustdoc cfg(test) feature 2019-06-08 18:26:06 +01:00
Alexander Regueiro
10b6daa6c8 Reblessed tests. 2019-06-05 21:09:27 +01:00
Andy Russell
89d437ec76
do not print panic message on doctest failures 2019-05-22 13:27:53 -04:00
John Kåre Alsaker
a1f2dceaeb Move edition outside the hygiene lock and avoid accessing it 2019-05-21 18:17:05 +02:00
Guillaume Gomez
c78af2bc60 Update rustdoc-ui tests 2019-05-18 12:45:29 +02:00
Guillaume Gomez
b5d4bd2a07 Fix lints handling in rustdoc 2019-05-18 12:45:29 +02:00
Mazdak Farrokhzad
06e1d88de6
Rollup merge of #60220 - euclio:rustdoc-test-fatal-parsing-errors, r=QuietMisdreavus
report fatal errors during doctest parsing

Fixes #59557.
2019-05-03 16:24:54 +02:00
Mazdak Farrokhzad
09a7051d28
Rollup merge of #59940 - GuillaumeGomez:rustdoc-test, r=ollie27
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-26 03:50:13 +02:00
Guillaume Gomez
459d677bff Add test for rustdoc cfg(test) feature 2019-04-24 22:26:42 +02:00
Andy Russell
a912664113
report fatal errors during doctest parsing 2019-04-24 00:03:53 -04:00
varkor
5392f44a92 Remove unnecessary tidy ignore directives 2019-04-23 11:42:15 +01:00