Skip to content

Commit 6fcbc3a

Browse files
committed
Do not warn in rustdoc test.
1 parent 748e95b commit 6fcbc3a

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

src/test/rustdoc-ui/display-output.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
/// #![warn(unused)]
1111
/// let x = 12;
1212
///
13-
/// fn foo(x: &std::fmt::Display) {}
13+
/// fn foo(x: &dyn std::fmt::Display) {}
1414
/// ```
1515
pub fn foo() {}

src/test/rustdoc-ui/display-output.stdout

+3-13
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ test $DIR/display-output.rs - foo (line 9) ... ok
55
successes:
66

77
---- $DIR/display-output.rs - foo (line 9) stdout ----
8-
warning: trait objects without an explicit `dyn` are deprecated
9-
--> $DIR/display-output.rs:13:12
10-
|
11-
LL | fn foo(x: &std::fmt::Display) {}
12-
| ^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn std::fmt::Display`
13-
|
14-
= note: `#[warn(bare_trait_objects)]` on by default
15-
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
16-
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
17-
188
warning: unused variable: `x`
199
--> $DIR/display-output.rs:11:5
2010
|
@@ -31,13 +21,13 @@ LL | #![warn(unused)]
3121
warning: unused variable: `x`
3222
--> $DIR/display-output.rs:13:8
3323
|
34-
LL | fn foo(x: &std::fmt::Display) {}
24+
LL | fn foo(x: &dyn std::fmt::Display) {}
3525
| ^ help: if this is intentional, prefix it with an underscore: `_x`
3626

3727
warning: function is never used: `foo`
3828
--> $DIR/display-output.rs:13:4
3929
|
40-
LL | fn foo(x: &std::fmt::Display) {}
30+
LL | fn foo(x: &dyn std::fmt::Display) {}
4131
| ^^^
4232
|
4333
note: the lint level is defined here
@@ -47,7 +37,7 @@ LL | #![warn(unused)]
4737
| ^^^^^^
4838
= note: `#[warn(dead_code)]` implied by `#[warn(unused)]`
4939

50-
warning: 4 warnings emitted
40+
warning: 3 warnings emitted
5141

5242

5343

0 commit comments

Comments
 (0)