about summary refs log tree commit diff
path: root/src/librustc_error_codes/error_codes
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2019-11-27 13:51:44 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2019-11-27 18:02:05 +0100
commitce696101c492964c31d5f368b27e6f2027af8f07 (patch)
tree68f7fb35368c0bf38d0ce16cf63c721e73559177 /src/librustc_error_codes/error_codes
parent38f9cd4d696a729dcf832a62af0f2eb43908bafb (diff)
Clean up E0081 long explanation
Diffstat (limited to 'src/librustc_error_codes/error_codes')
-rw-r--r--src/librustc_error_codes/error_codes/E0081.md18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/librustc_error_codes/error_codes/E0081.md b/src/librustc_error_codes/error_codes/E0081.md
index ec88ca9765e..fd5eca68e21 100644
--- a/src/librustc_error_codes/error_codes/E0081.md
+++ b/src/librustc_error_codes/error_codes/E0081.md
@@ -1,21 +1,23 @@
-Enum discriminants are used to differentiate enum variants stored in memory.
-This error indicates that the same value was used for two or more variants,
-making them impossible to tell apart.
+A discrimant value is present more than once.
+
+Erroneous code example:
 
 ```compile_fail,E0081
-// Bad.
 enum Enum {
     P = 3,
-    X = 3,
+    X = 3, // error!
     Y = 5,
 }
 ```
 
+Enum discriminants are used to differentiate enum variants stored in memory.
+This error indicates that the same value was used for two or more variants,
+making it impossible to distinguish them.
+
 ```
-// Good.
 enum Enum {
     P,
-    X = 3,
+    X = 3, // ok!
     Y = 5,
 }
 ```
@@ -27,7 +29,7 @@ variants.
 ```compile_fail,E0081
 enum Bad {
     X,
-    Y = 0
+    Y = 0, // error!
 }
 ```