-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools
Description
Location
https://doc.rust-lang.org/error_codes/E0191.html
Trait objects need to have all associated types specified. Please verify that all associated types of the trait were specified and the correct trait was used. Example:
trait Trait { type Bar; } type Foo = Trait<Bar=i32>; // ok!
Summary
But according to E0782, trait objects must include the dyn
keyword:
error[[E0782]](https://doc.rust-lang.org/stable/error_codes/E0782.html): trait objects must include the `dyn` keyword
--> src/lib.rs:5:12
|
5 | type Foo = Trait<Bar=i32>; // ok!
| ^^^^^^^^^^^^^^
|
help: add `dyn` keyword before this trait
|
5 | type Foo = dyn Trait<Bar=i32>; // ok!
| +++
For more information about this error, try `rustc --explain E0782`.
error: could not compile `playground` (lib) due to previous error
I think the examples for E0191 should be updated.
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and tools