diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/editions/dyn-trait-sugg-2021.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/editions/dyn-trait-sugg-2021.rs b/src/test/ui/editions/dyn-trait-sugg-2021.rs new file mode 100644 index 000000000..de0444b63 --- /dev/null +++ b/src/test/ui/editions/dyn-trait-sugg-2021.rs @@ -0,0 +1,12 @@ +// edition:2021 + +trait Foo<T> {} + +impl<T> dyn Foo<T> { + fn hi(_x: T) {} +} + +fn main() { + Foo::hi(123); + //~^ ERROR trait objects must include the `dyn` keyword +} |