about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_error_codes/error_codes/E0178.md25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/librustc_error_codes/error_codes/E0178.md b/src/librustc_error_codes/error_codes/E0178.md
index 07980ad83f1..0c6f918632f 100644
--- a/src/librustc_error_codes/error_codes/E0178.md
+++ b/src/librustc_error_codes/error_codes/E0178.md
@@ -1,16 +1,27 @@
-In types, the `+` type operator has low precedence, so it is often necessary
-to use parentheses.
+The `+` type operator was used in an ambiguous context.
 
-For example:
+Erroneous code example:
 
 ```compile_fail,E0178
 trait Foo {}
 
 struct Bar<'a> {
-    w: &'a Foo + Copy,   // error, use &'a (Foo + Copy)
-    x: &'a Foo + 'a,     // error, use &'a (Foo + 'a)
-    y: &'a mut Foo + 'a, // error, use &'a mut (Foo + 'a)
-    z: fn() -> Foo + 'a, // error, use fn() -> (Foo + 'a)
+    x: &'a Foo + 'a,     // error!
+    y: &'a mut Foo + 'a, // error!
+    z: fn() -> Foo + 'a, // error!
+}
+```
+
+In types, the `+` type operator has low precedence, so it is often necessary
+to use parentheses:
+
+```
+trait Foo {}
+
+struct Bar<'a> {
+    x: &'a (Foo + 'a),     // ok!
+    y: &'a mut (Foo + 'a), // ok!
+    z: fn() -> (Foo + 'a), // ok!
 }
 ```