Skip to content

Commit

Permalink
Rollup merge of #65179 - GuillaumeGomez:long-err-explanation-E0567, r…
Browse files Browse the repository at this point in the history
…=davidtwco

Add long error explanation for E0567

Part of #61137.
  • Loading branch information
Centril committed Oct 8, 2019
2 parents 0d17de8 + 6608e4a commit 3246ab2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
29 changes: 28 additions & 1 deletion src/librustc_passes/error_codes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/auto-trait-validation.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ LL | auto trait MyTrait { fn foo() {} }

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0380`.
Some errors have detailed explanations: E0380, E0567.
For more information about an error, try `rustc --explain E0380`.

0 comments on commit 3246ab2

Please sign in to comment.