about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-06-11 13:34:04 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-06-11 13:34:04 +0200
commit9da3a7aece2483ca05630c820c5beda4bb579edd (patch)
tree8d1b4f71919a38a558e258640fcdd3a25bc6f078 /src
parentccac43b86b559e01fa71179af1a838ab94559c75 (diff)
downloadrust-9da3a7aece2483ca05630c820c5beda4bb579edd.tar.gz
rust-9da3a7aece2483ca05630c820c5beda4bb579edd.zip
Clean up E0666 explanation
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!
+) {}
 ```