Closed
Description
Given the following code: link
trait A { }
impl A {
}
fn main() {
}
The current output is:
Compiling playground v0.0.1 (/playground)
error[[E0782]](https://doc.rust-lang.org/nightly/error-index.html#E0782): trait objects must include the `dyn` keyword
--> src/main.rs:3:6
|
3 | impl A {
| ^
|
help: add `dyn` keyword before this trait
|
3 - impl A {
3 + impl dyn A {
|
For more information about this error, try `rustc --explain E0782`.
error: could not compile `playground` due to previous error
Ideally the output should look like:
Compiling playground v0.0.1 (/playground)
error[[E0782]](https://doc.rust-lang.org/nightly/error-index.html#E0782): trait objects must include the `dyn` keyword
--> src/main.rs:3:6
|
3 | impl A {
| ^
|
help: add `dyn` keyword before trait `A`
|
3 | impl dyn A {
| +++
For more information about this error, try `rustc --explain E0782`.
error: could not compile `playground` due to previous error
Above changes: use a more common +
convention for the help suggestion and make the target trait more explicit by mentioning it.
Since most of the other help suggestion that requires adding something uses the +
convention, I think we should also change the above suggestion to use that convention to make things more uniform. On top of that the new proposed output is less verbose as it reduces 1 line of output.
Note: If the old "diff" convention for the help suggestion is intentional, please let me know the reason and I will gladly close this issue. Thanks.