]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0576.md
Merge commit 'c1664c50b27a51f7a78c93ba65558e7c33eabee6' into clippyup
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0576.md
1 An associated item wasn't found in the given type.
2
3 Erroneous code example:
4
5 ```compile_fail,E0576
6 trait Hello {
7     type Who;
8
9     fn hello() -> <Self as Hello>::You; // error!
10 }
11 ```
12
13 In this example, we tried to use the non-existent associated type `You` of the
14 `Hello` trait. To fix this error, use an existing associated type:
15
16 ```
17 trait Hello {
18     type Who;
19
20     fn hello() -> <Self as Hello>::Who; // ok!
21 }
22 ```