@@ -21,7 +21,7 @@ LL | impl<'a, T> Trait<'a, T> for Enum<T> {}
21
21
| ~~~~~~~~~~~~ ~~~~~~~
22
22
23
23
error[E0404]: expected trait, found union `Union`
24
- --> $DIR/suggest-swapping-self-ty-and-trait.rs:18 :13
24
+ --> $DIR/suggest-swapping-self-ty-and-trait.rs:20 :13
25
25
|
26
26
LL | impl<'a, T> Union<T> for Trait<'a, T> {}
27
27
| ^^^^^^^^ not a trait
@@ -45,6 +45,32 @@ help: if this is an object-safe trait, use `dyn`
45
45
LL | impl<'a, T> Struct<T> for dyn Trait<'a, T> {}
46
46
| +++
47
47
48
- error: aborting due to 3 previous errors; 1 warning emitted
48
+ warning: trait objects without an explicit `dyn` are deprecated
49
+ --> $DIR/suggest-swapping-self-ty-and-trait.rs:15:25
50
+ |
51
+ LL | impl<'a, T> Enum<T> for Trait<'a, T> {}
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: if this is an object-safe trait, use `dyn`
57
+ |
58
+ LL | impl<'a, T> Enum<T> for dyn Trait<'a, T> {}
59
+ | +++
60
+
61
+ warning: trait objects without an explicit `dyn` are deprecated
62
+ --> $DIR/suggest-swapping-self-ty-and-trait.rs:20:26
63
+ |
64
+ LL | impl<'a, T> Union<T> for Trait<'a, T> {}
65
+ | ^^^^^^^^^^^^
66
+ |
67
+ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
68
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
69
+ help: if this is an object-safe trait, use `dyn`
70
+ |
71
+ LL | impl<'a, T> Union<T> for dyn Trait<'a, T> {}
72
+ | +++
73
+
74
+ error: aborting due to 3 previous errors; 3 warnings emitted
49
75
50
76
For more information about this error, try `rustc --explain E0404`.
0 commit comments