mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
36 lines
1.1 KiB
Text
36 lines
1.1 KiB
Text
error[E0782]: trait objects must include the `dyn` keyword
|
|
--> $DIR/dyn-2021-edition-error.rs:3:17
|
|
|
|
|
LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
|
| ^^^^^^^^^
|
|
|
|
|
help: add `dyn` keyword before this trait
|
|
|
|
|
LL | fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
|
|
| +++
|
|
|
|
error[E0782]: trait objects must include the `dyn` keyword
|
|
--> $DIR/dyn-2021-edition-error.rs:3:35
|
|
|
|
|
LL | fn function(x: &SomeTrait, y: Box<SomeTrait>) {
|
|
| ^^^^^^^^^
|
|
|
|
|
help: add `dyn` keyword before this trait
|
|
|
|
|
LL | fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
|
|
| +++
|
|
|
|
error[E0782]: trait objects must include the `dyn` keyword
|
|
--> $DIR/dyn-2021-edition-error.rs:6:14
|
|
|
|
|
LL | let _x: &SomeTrait = todo!();
|
|
| ^^^^^^^^^
|
|
|
|
|
help: add `dyn` keyword before this trait
|
|
|
|
|
LL | let _x: &dyn SomeTrait = todo!();
|
|
| +++
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0782`.
|