File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,34 @@ type A3 = fn(i16); // ok!
314314```
315315"## ,
316316
317+ E0567 : r##"
318+ Generics have been used on an auto trait.
319+
320+ Erroneous code example:
321+
322+ ```compile_fail,E0567
323+ #![feature(optin_builtin_traits)]
324+
325+ auto trait Generic<T> {} // error!
326+
327+ fn main() {}
328+ ```
329+
330+ Since an auto trait is implemented on all existing types, the
331+ compiler would not be able to infer the types of the trait's generic
332+ parameters.
333+
334+ To fix this issue, just remove the generics:
335+
336+ ```
337+ #![feature(optin_builtin_traits)]
338+
339+ auto trait Generic {} // ok!
340+
341+ fn main() {}
342+ ```
343+ "## ,
344+
317345E0571 : r##"
318346A `break` statement with an argument appeared in a non-`loop` loop.
319347
@@ -531,7 +559,6 @@ Switch to the Rust 2018 edition to use `async fn`.
531559;
532560 E0226 , // only a single explicit lifetime bound is permitted
533561 E0472 , // asm! is unsupported on this target
534- E0567 , // auto traits can not have generic parameters
535562 E0568 , // auto traits can not have super traits
536563 E0666 , // nested `impl Trait` is illegal
537564 E0667 , // `impl Trait` in projections
Original file line number Diff line number Diff line change @@ -18,4 +18,5 @@ LL | auto trait MyTrait { fn foo() {} }
1818
1919error: aborting due to 3 previous errors
2020
21- For more information about this error, try `rustc --explain E0380`.
21+ Some errors have detailed explanations: E0380, E0567.
22+ For more information about an error, try `rustc --explain E0380`.
You can’t perform that action at this time.
0 commit comments