]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | Generics have been used on an auto trait. |
2 | ||
3 | Erroneous code example: | |
4 | ||
5 | ```compile_fail,E0567 | |
6 | #![feature(optin_builtin_traits)] | |
7 | ||
8 | auto trait Generic<T> {} // error! | |
f9f354fc | 9 | # fn main() {} |
60c5eb7d XL |
10 | ``` |
11 | ||
12 | Since an auto trait is implemented on all existing types, the | |
13 | compiler would not be able to infer the types of the trait's generic | |
14 | parameters. | |
15 | ||
16 | To fix this issue, just remove the generics: | |
17 | ||
18 | ``` | |
19 | #![feature(optin_builtin_traits)] | |
20 | ||
21 | auto trait Generic {} // ok! | |
f9f354fc | 22 | # fn main() {} |
60c5eb7d | 23 | ``` |