]>
Commit | Line | Data |
---|---|---|
dfeec247 XL |
1 | An associated type wasn't specified for a trait object. |
2 | ||
3 | Erroneous code example: | |
60c5eb7d XL |
4 | |
5 | ```compile_fail,E0191 | |
6 | trait Trait { | |
7 | type Bar; | |
8 | } | |
9 | ||
781aab86 FG |
10 | type Foo = dyn Trait; // error: the value of the associated type `Bar` (from |
11 | // the trait `Trait`) must be specified | |
60c5eb7d XL |
12 | ``` |
13 | ||
dfeec247 XL |
14 | Trait objects need to have all associated types specified. Please verify that |
15 | all associated types of the trait were specified and the correct trait was used. | |
16 | Example: | |
60c5eb7d XL |
17 | |
18 | ``` | |
19 | trait Trait { | |
20 | type Bar; | |
21 | } | |
22 | ||
781aab86 | 23 | type Foo = dyn Trait<Bar=i32>; // ok! |
60c5eb7d | 24 | ``` |