Add detailed explaination for E0666

This commit is contained in:
Sydney Acksman 2019-10-26 17:44:23 -05:00
parent 8318ef26c1
commit 4b2b23cc07
4 changed files with 28 additions and 3 deletions

View File

@ -552,6 +552,30 @@ trait Foo {
```
"##,
E0666: r##"
`impl Trait` types cannot appear nested in the
generic types of other `impl Trait` types.
Example of erroneous code:
```compile_fail,E0666
trait MyGenericTrait<T> {}
trait MyInnerTrait {}
fn foo(bar: impl MyGenericTrait<impl MyInnerTrait>) {}
```
Type parameters for `impl Trait` types must be
explicitly defined as named generic parameters:
```
trait MyGenericTrait<T> {}
trait MyInnerTrait {}
fn foo<T: MyInnerTrait>(bar: impl MyGenericTrait<T>) {}
```
"##,
E0695: r##"
A `break` statement without a label appeared inside a labeled block.
@ -605,7 +629,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
E0666, // nested `impl Trait` is illegal
E0667, // `impl Trait` in projections
E0696, // `continue` pointing to a labeled block
E0706, // `async fn` in trait

View File

@ -27,3 +27,4 @@ LL | pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
error: aborting due to 3 previous errors
For more information about this error, try `rustc --explain E0666`.

View File

@ -272,5 +272,5 @@ LL | type Out = impl Debug;
error: aborting due to 43 previous errors
Some errors have detailed explanations: E0282, E0562, E0658.
Some errors have detailed explanations: E0282, E0562, E0658, E0666.
For more information about an error, try `rustc --explain E0282`.

View File

@ -48,4 +48,5 @@ LL | fn allowed_in_ret_type() -> impl Fn() -> impl Into<u32> {
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0562`.
Some errors have detailed explanations: E0562, E0666.
For more information about an error, try `rustc --explain E0562`.