@@ -21,7 +21,7 @@ LL | impl<'a, T> Trait<'a, T> for Enum<T> {}
2121 | ~~~~~~~~~~~~ ~~~~~~~
2222
2323error[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
2525 |
2626LL | impl<'a, T> Union<T> for Trait<'a, T> {}
2727 | ^^^^^^^^ not a trait
@@ -45,6 +45,32 @@ help: if this is an object-safe trait, use `dyn`
4545LL | impl<'a, T> Struct<T> for dyn Trait<'a, T> {}
4646 | +++
4747
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
4975
5076For more information about this error, try `rustc --explain E0404`.
0 commit comments