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 03:00:54 -05:00
fn hi(_x: T) {}
}
fn main() {
Foo::hi(123);
2021-07-10 03:00:54 -05:00
//~^ ERROR trait objects must include the `dyn` keyword
}