Skip to content

Commit 748e95b

Browse files
committed
Bless tests.
1 parent d3a6d4b commit 748e95b

File tree

4 files changed

+163
-3
lines changed

4 files changed

+163
-3
lines changed

src/test/ui/dyn-keyword/dyn-2018-edition-lint.rs

+10
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@ fn function(x: &SomeTrait, y: Box<SomeTrait>) {
66
//~| WARN this is accepted in the current edition
77
//~| ERROR trait objects without an explicit `dyn` are deprecated
88
//~| WARN this is accepted in the current edition
9+
//~| ERROR trait objects without an explicit `dyn` are deprecated
10+
//~| WARN this is accepted in the current edition
11+
//~| ERROR trait objects without an explicit `dyn` are deprecated
12+
//~| WARN this is accepted in the current edition
13+
//~| ERROR trait objects without an explicit `dyn` are deprecated
14+
//~| WARN this is accepted in the current edition
15+
//~| ERROR trait objects without an explicit `dyn` are deprecated
16+
//~| WARN this is accepted in the current edition
917
let _x: &SomeTrait = todo!();
18+
//~^ ERROR trait objects without an explicit `dyn` are deprecated
19+
//~| WARN this is accepted in the current edition
1020
}
1121

1222
trait SomeTrait {}

src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr

+71-1
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,75 @@ LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
3131
LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
3232
|
3333

34-
error: aborting due to 2 previous errors
34+
error: trait objects without an explicit `dyn` are deprecated
35+
--> $DIR/dyn-2018-edition-lint.rs:17:14
36+
|
37+
LL | let _x: &SomeTrait = todo!();
38+
| ^^^^^^^^^
39+
|
40+
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
41+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
42+
help: use `dyn`
43+
|
44+
LL - let _x: &SomeTrait = todo!();
45+
LL + let _x: &dyn SomeTrait = todo!();
46+
|
47+
48+
error: trait objects without an explicit `dyn` are deprecated
49+
--> $DIR/dyn-2018-edition-lint.rs:4:17
50+
|
51+
LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
52+
| ^^^^^^^^^
53+
|
54+
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
55+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
56+
help: use `dyn`
57+
|
58+
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
59+
LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
60+
|
61+
62+
error: trait objects without an explicit `dyn` are deprecated
63+
--> $DIR/dyn-2018-edition-lint.rs:4:17
64+
|
65+
LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
66+
| ^^^^^^^^^
67+
|
68+
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
69+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
70+
help: use `dyn`
71+
|
72+
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
73+
LL + fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
74+
|
75+
76+
error: trait objects without an explicit `dyn` are deprecated
77+
--> $DIR/dyn-2018-edition-lint.rs:4:35
78+
|
79+
LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
80+
| ^^^^^^^^^
81+
|
82+
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
83+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
84+
help: use `dyn`
85+
|
86+
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
87+
LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
88+
|
89+
90+
error: trait objects without an explicit `dyn` are deprecated
91+
--> $DIR/dyn-2018-edition-lint.rs:4:35
92+
|
93+
LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
94+
| ^^^^^^^^^
95+
|
96+
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
97+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
98+
help: use `dyn`
99+
|
100+
LL - fn function(x: &SomeTrait, y: Box<SomeTrait>) {
101+
LL + fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
102+
|
103+
104+
error: aborting due to 7 previous errors
35105

src/test/ui/suggestions/issue-61963.rs

+10
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,20 @@ pub struct Qux<T>(T);
1818
pub struct Foo {
1919
//~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
2020
//~| WARN this is accepted in the current edition
21+
//~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
22+
//~| WARN this is accepted in the current edition
23+
//~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
24+
//~| WARN this is accepted in the current edition
25+
//~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
26+
//~| WARN this is accepted in the current edition
2127
qux: Qux<Qux<Baz>>,
2228
bar: Box<Bar>,
2329
//~^ ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
2430
//~| WARN this is accepted in the current edition
31+
//~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
32+
//~| WARN this is accepted in the current edition
33+
//~| ERROR trait objects without an explicit `dyn` are deprecated [bare_trait_objects]
34+
//~| WARN this is accepted in the current edition
2535
}
2636

2737
fn main() {}

src/test/ui/suggestions/issue-61963.stderr

+72-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: trait objects without an explicit `dyn` are deprecated
2-
--> $DIR/issue-61963.rs:22:14
2+
--> $DIR/issue-61963.rs:28:14
33
|
44
LL | bar: Box<Bar>,
55
| ^^^
@@ -31,5 +31,75 @@ LL - pub struct Foo {
3131
LL + dyn pub struct Foo {
3232
|
3333

34-
error: aborting due to 2 previous errors
34+
error: trait objects without an explicit `dyn` are deprecated
35+
--> $DIR/issue-61963.rs:28:14
36+
|
37+
LL | bar: Box<Bar>,
38+
| ^^^
39+
|
40+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
41+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
42+
help: use `dyn`
43+
|
44+
LL - bar: Box<Bar>,
45+
LL + bar: Box<dyn Bar>,
46+
|
47+
48+
error: trait objects without an explicit `dyn` are deprecated
49+
--> $DIR/issue-61963.rs:28:14
50+
|
51+
LL | bar: Box<Bar>,
52+
| ^^^
53+
|
54+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
55+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
56+
help: use `dyn`
57+
|
58+
LL - bar: Box<Bar>,
59+
LL + bar: Box<dyn Bar>,
60+
|
61+
62+
error: trait objects without an explicit `dyn` are deprecated
63+
--> $DIR/issue-61963.rs:18:1
64+
|
65+
LL | pub struct Foo {
66+
| ^^^
67+
|
68+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
69+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
70+
help: use `dyn`
71+
|
72+
LL - pub struct Foo {
73+
LL + dyn pub struct Foo {
74+
|
75+
76+
error: trait objects without an explicit `dyn` are deprecated
77+
--> $DIR/issue-61963.rs:18:1
78+
|
79+
LL | pub struct Foo {
80+
| ^^^
81+
|
82+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
83+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
84+
help: use `dyn`
85+
|
86+
LL - pub struct Foo {
87+
LL + dyn pub struct Foo {
88+
|
89+
90+
error: trait objects without an explicit `dyn` are deprecated
91+
--> $DIR/issue-61963.rs:18:1
92+
|
93+
LL | pub struct Foo {
94+
| ^^^
95+
|
96+
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
97+
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
98+
help: use `dyn`
99+
|
100+
LL - pub struct Foo {
101+
LL + dyn pub struct Foo {
102+
|
103+
104+
error: aborting due to 7 previous errors
35105

0 commit comments

Comments
 (0)