forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#91259 - jyn514:doctest-warnings, r=Guillaum…
…eGomez Remove `--display-doctest-warnings` `--display-doctest-warnings` can be replicated in full with other existing features, there's no need to have a separate option for it. This removes the option and documents the combination of other features to replicate it. This also fixes a bug where `--test-args=--show-output` had no effect. cc `@ollie27,` rust-lang#73314 (comment) Fixes rust-lang#41574 r? `@GuillaumeGomez`
- Loading branch information
Showing
8 changed files
with
68 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
// Test that `--show-output` has an effect and `allow(unused)` can be overriden. | ||
|
||
// check-pass | ||
// compile-flags:-Zunstable-options --display-doctest-warnings --test | ||
// edition:2018 | ||
// compile-flags:--test --test-args=--show-output | ||
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" | ||
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME" | ||
|
||
/// ``` | ||
/// #![warn(unused)] | ||
/// let x = 12; | ||
/// | ||
/// fn foo(x: &std::fmt::Display) {} | ||
/// ``` | ||
pub fn foo() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,58 @@ | ||
|
||
running 1 test | ||
test $DIR/display-output.rs - foo (line 6) ... ok | ||
test $DIR/display-output.rs - foo (line 9) ... ok | ||
|
||
successes: | ||
|
||
---- $DIR/display-output.rs - foo (line 6) stdout ---- | ||
---- $DIR/display-output.rs - foo (line 9) stdout ---- | ||
warning: trait objects without an explicit `dyn` are deprecated | ||
--> $DIR/display-output.rs:13:12 | ||
| | ||
LL | fn foo(x: &std::fmt::Display) {} | ||
| ^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn std::fmt::Display` | ||
| | ||
= note: `#[warn(bare_trait_objects)]` on by default | ||
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! | ||
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html> | ||
|
||
warning: unused variable: `x` | ||
--> $DIR/display-output.rs:7:5 | ||
--> $DIR/display-output.rs:11:5 | ||
| | ||
LL | let x = 12; | ||
| ^ help: if this is intentional, prefix it with an underscore: `_x` | ||
| | ||
= note: `#[warn(unused_variables)]` on by default | ||
note: the lint level is defined here | ||
--> $DIR/display-output.rs:9:9 | ||
| | ||
LL | #![warn(unused)] | ||
| ^^^^^^ | ||
= note: `#[warn(unused_variables)]` implied by `#[warn(unused)]` | ||
|
||
warning: unused variable: `x` | ||
--> $DIR/display-output.rs:13:8 | ||
| | ||
LL | fn foo(x: &std::fmt::Display) {} | ||
| ^ help: if this is intentional, prefix it with an underscore: `_x` | ||
|
||
warning: function is never used: `foo` | ||
--> $DIR/display-output.rs:13:4 | ||
| | ||
LL | fn foo(x: &std::fmt::Display) {} | ||
| ^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/display-output.rs:9:9 | ||
| | ||
LL | #![warn(unused)] | ||
| ^^^^^^ | ||
= note: `#[warn(dead_code)]` implied by `#[warn(unused)]` | ||
|
||
warning: 1 warning emitted | ||
warning: 4 warnings emitted | ||
|
||
|
||
|
||
successes: | ||
$DIR/display-output.rs - foo (line 6) | ||
$DIR/display-output.rs - foo (line 9) | ||
|
||
test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in $TIME | ||
|