about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-10-07 12:59:39 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-10-08 13:57:39 +0200
commit61d92a09529818bdd3ed832a7e2fdd6394c358bf (patch)
treef64c8aaa007464d8a98ad3a2bbcc861a147f32d7
parentec557aa8180ca08ff749793b3d42383618b96044 (diff)
downloadrust-61d92a09529818bdd3ed832a7e2fdd6394c358bf.tar.gz
rust-61d92a09529818bdd3ed832a7e2fdd6394c358bf.zip
Add long error explanation for E0567
-rw-r--r--src/librustc_passes/error_codes.rs29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/librustc_passes/error_codes.rs b/src/librustc_passes/error_codes.rs
index a3c46f7a6fc..fbd06c34800 100644
--- a/src/librustc_passes/error_codes.rs
+++ b/src/librustc_passes/error_codes.rs
@@ -314,6 +314,34 @@ type A3 = fn(i16); // ok!
 ```
 "##,
 
+E0567: r##"
+Generics have been used on an auto trait.
+
+Erroneous code example:
+
+```compile_fail,E0567
+#![feature(optin_builtin_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(optin_builtin_traits)]
+
+auto trait Generic {} // ok!
+
+fn main() {}
+```
+"##,
+
 E0571: r##"
 A `break` statement with an argument appeared in a non-`loop` loop.
 
@@ -531,7 +559,6 @@ Switch to the Rust 2018 edition to use `async fn`.
 ;
     E0226, // only a single explicit lifetime bound is permitted
     E0472, // asm! is unsupported on this target
-    E0567, // auto traits can not have generic parameters
     E0568, // auto traits can not have super traits
     E0666, // nested `impl Trait` is illegal
     E0667, // `impl Trait` in projections