]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_error_codes/src/error_codes/E0191.md
New upstream version 1.74.1+dfsg1
[rustc.git] / compiler / rustc_error_codes / src / error_codes / E0191.md
CommitLineData
dfeec247
XL
1An associated type wasn't specified for a trait object.
2
3Erroneous code example:
60c5eb7d
XL
4
5```compile_fail,E0191
6trait Trait {
7 type Bar;
8}
9
781aab86
FG
10type 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
14Trait objects need to have all associated types specified. Please verify that
15all associated types of the trait were specified and the correct trait was used.
16Example:
60c5eb7d
XL
17
18```
19trait Trait {
20 type Bar;
21}
22
781aab86 23type Foo = dyn Trait<Bar=i32>; // ok!
60c5eb7d 24```