diff options
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0567.md')
-rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0567.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0567.md b/compiler/rustc_error_codes/src/error_codes/E0567.md new file mode 100644 index 000000000..bc13ee4c0 --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0567.md @@ -0,0 +1,23 @@ +Generics have been used on an auto trait. + +Erroneous code example: + +```compile_fail,E0567 +#![feature(auto_traits)] + +auto trait Generic<T> {} // error! +# fn main() {} +``` + +Since an auto trait is implemented on all existing types, the +compiler would not be able to infer the types of the trait's generic +parameters. + +To fix this issue, just remove the generics: + +``` +#![feature(auto_traits)] + +auto trait Generic {} // ok! +# fn main() {} +``` |