Compiling playground v0.0.1 (/playground)
error[[E0782]](https://doc.rust-lang.org/stable/error-index.html#E0782): trait objects must include the `dyn` keyword
--> src/main.rs:13:29
|
13 | fn dynamic_dispatch(t: &Bar) {
| ^^^
|
help: add `dyn` keyword before this trait
|
13 | fn dynamic_dispatch(t: &dyn Bar) {
| +++
For more information about this error, try `rustc --explain E0782`.
error: could not compile `playground` due to previous error
页码与行数
文本或排版错误
代码错误
2021 版本前是可以这么写,但现在是错误了。
Rust版本
错误信息