diff --git a/src/librustc_error_codes/error_codes/E0666.md b/src/librustc_error_codes/error_codes/E0666.md index 22133683dc5ac..1a0dc5a522962 100644 --- a/src/librustc_error_codes/error_codes/E0666.md +++ b/src/librustc_error_codes/error_codes/E0666.md @@ -1,21 +1,25 @@ -`impl Trait` types cannot appear nested in the -generic arguments of other `impl Trait` types. +`impl Trait` types cannot appear nested in the generic arguments of other +`impl Trait` types. -Example of erroneous code: +Erroneous code example: ```compile_fail,E0666 trait MyGenericTrait {} trait MyInnerTrait {} -fn foo(bar: impl MyGenericTrait) {} +fn foo( + bar: impl MyGenericTrait, // error! +) {} ``` -Type parameters for `impl Trait` types must be -explicitly defined as named generic parameters: +Type parameters for `impl Trait` types must be explicitly defined as named +generic parameters: ``` trait MyGenericTrait {} trait MyInnerTrait {} -fn foo(bar: impl MyGenericTrait) {} +fn foo( + bar: impl MyGenericTrait, // ok! +) {} ```