diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-05-05 17:35:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-05-05 17:35:27 -0400 |
| commit | ecd7b48b25740160a6b8942085e8417acf7ebb28 (patch) | |
| tree | 4fff80df6682530283aaa76ae64f69da38a9b739 /src/test/incremental/thinlto | |
| parent | b091d6ed428a5edb67ad24850374e75e7f615c93 (diff) | |
| parent | d5863e99853c22c649a1787f40c47b60795ea93d (diff) | |
| download | rust-ecd7b48b25740160a6b8942085e8417acf7ebb28.tar.gz rust-ecd7b48b25740160a6b8942085e8417acf7ebb28.zip | |
Rollup merge of #41678 - GuillaumeGomez:rustdoc-test-warnings, r=alexcrichton
Add option to display warnings in rustdoc
Part of #41574.
r? @alexcrichton
The output for this file:
```rust
/// ```
/// fn foo(x: u32) {}
///
/// foo(2);
/// let x = 1;
/// panic!();
/// ```
fn foo() {}
/// ```
/// fn foo(x: u32) {}
///
/// foo(2);
/// let x = 1;
/// ```
fn foo2() {}
/// ```
/// fn foo(x: u32) {}
///
/// foo(2);
/// let x = 1;
/// panic!();
/// ```
fn foo3() {}
fn main() {
}
```
is the following:
```
> ./build/x86_64-apple-darwin/stage1/bin/rustdoc -Z unstable-options --display-warnings --test test.rs
running 3 tests
test test.rs - foo (line 1) ... FAILED
test test.rs - foo3 (line 18) ... FAILED
test test.rs - foo2 (line 10) ... ok
successes:
---- test.rs - foo2 (line 10) stdout ----
warning: unused variable: `x`
--> <anon>:2:8
|
2 | fn foo(x: u32) {}
| ^
|
= note: #[warn(unused_variables)] on by default
warning: unused variable: `x`
--> <anon>:5:5
|
5 | let x = 1;
| ^
|
= note: #[warn(unused_variables)] on by default
successes:
test.rs - foo2 (line 10)
failures:
---- test.rs - foo (line 1) stdout ----
warning: unused variable: `x`
--> <anon>:2:8
|
2 | fn foo(x: u32) {}
| ^
|
= note: #[warn(unused_variables)] on by default
warning: unused variable: `x`
--> <anon>:5:5
|
5 | let x = 1;
| ^
|
= note: #[warn(unused_variables)] on by default
thread 'rustc' panicked at 'test executable failed:
thread 'main' panicked at 'explicit panic', <anon>:6
note: Run with `RUST_BACKTRACE=1` for a backtrace.
', src/librustdoc/test.rs:317
note: Run with `RUST_BACKTRACE=1` for a backtrace.
---- test.rs - foo3 (line 18) stdout ----
warning: unused variable: `x`
--> <anon>:2:8
|
2 | fn foo(x: u32) {}
| ^
|
= note: #[warn(unused_variables)] on by default
warning: unused variable: `x`
--> <anon>:5:5
|
5 | let x = 1;
| ^
|
= note: #[warn(unused_variables)] on by default
thread 'rustc' panicked at 'test executable failed:
thread 'main' panicked at 'explicit panic', <anon>:6
note: Run with `RUST_BACKTRACE=1` for a backtrace.
', src/librustdoc/test.rs:317
failures:
test.rs - foo (line 1)
test.rs - foo3 (line 18)
test result: FAILED. 1 passed; 2 failed; 0 ignored; 0 measured
```
Diffstat (limited to 'src/test/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions
