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