about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-06-12 12:28:29 +0200
committerGitHub <noreply@github.com>2020-06-12 12:28:29 +0200
commitb4cb12fd2140421e9c9a4965e247c246f3896564 (patch)
treed87d6f1124120c4f3551e22f31857e7f6b3c31dc /src
parent6f9d45351031eedff0336baa20d26d789870c988 (diff)
parent9da3a7aece2483ca05630c820c5beda4bb579edd (diff)
Rollup merge of #73236 - GuillaumeGomez:cleanup-e0666, r=Dylan-DPC
Clean up E0666 explanation

r? @Dylan-DPC
Diffstat (limited to 'src')
-rw-r--r--src/librustc_error_codes/error_codes/E0666.md18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/librustc_error_codes/error_codes/E0666.md b/src/librustc_error_codes/error_codes/E0666.md
index 22133683dc5..1a0dc5a5229 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<T> {}
 trait MyInnerTrait {}
 
-fn foo(bar: impl MyGenericTrait<impl MyInnerTrait>) {}
+fn foo(
+    bar: impl MyGenericTrait<impl MyInnerTrait>, // 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<T> {}
 trait MyInnerTrait {}
 
-fn foo<T: MyInnerTrait>(bar: impl MyGenericTrait<T>) {}
+fn foo<T: MyInnerTrait>(
+    bar: impl MyGenericTrait<T>, // ok!
+) {}
 ```