rust/tests/ui/editions/dyn-trait-sugg-2021.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
170 B
Rust
Raw Normal View History

// edition:2021
trait Foo<T> {}
impl<T> dyn Foo<T> {
2021-07-10 08:00:54 +00:00
fn hi(_x: T) {}
}
fn main() {
Foo::hi(123);
2021-07-10 08:00:54 +00:00
//~^ ERROR trait objects must include the `dyn` keyword
}