Closed
Description
Given the following code: Playground
pub trait Trait {}
pub struct Struct {}
impl Struct for Trait {}
The current output is:
error[E0404]: expected trait, found struct `Struct`
--> src/lib.rs:5:6
|
5 | impl Struct for Trait {}
| ^^^^^^ not a trait
warning: trait objects without an explicit `dyn` are deprecated
--> src/lib.rs:5:17
|
5 | impl Struct for Trait {}
| ^^^^^ help: use `dyn`: `dyn Trait`
|
= 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 issue #80165 <https://github.com/rust-lang/rust/issues/80165>