]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0191.md
Rollup merge of #93556 - dtolnay:trailingcomma, r=cjgillot
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0191.md
1 An associated type wasn't specified for a trait object.
2
3 Erroneous code example:
4
5 ```compile_fail,E0191
6 trait Trait {
7     type Bar;
8 }
9
10 type Foo = Trait; // error: the value of the associated type `Bar` (from
11                   //        the trait `Trait`) must be specified
12 ```
13
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:
17
18 ```
19 trait Trait {
20     type Bar;
21 }
22
23 type Foo = Trait<Bar=i32>; // ok!
24 ```