]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0567.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / 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(auto_traits)]
7
8 auto trait Generic<T> {} // error!
9 # fn main() {}
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(auto_traits)]
20
21 auto trait Generic {} // ok!
22 # fn main() {}
23 ```