]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0567.md
Auto merge of #66396 - smmalis37:pythontest, r=alexcrichton
[rust.git] / src / librustc_error_codes / error_codes / E0567.md
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!
9
10 fn main() {}
11 ```
12
13 Since an auto trait is implemented on all existing types, the
14 compiler would not be able to infer the types of the trait's generic
15 parameters.
16
17 To fix this issue, just remove the generics:
18
19 ```
20 #![feature(optin_builtin_traits)]
21
22 auto trait Generic {} // ok!
23
24 fn main() {}
25 ```