File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
src/librustc_error_codes/error_codes Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 1- Enum discriminants are used to differentiate enum variants stored in memory .
2- This error indicates that the same value was used for two or more variants,
3- making them impossible to tell apart.
1+ A discrimant value is present more than once .
2+
3+ Erroneous code example:
44
55``` compile_fail,E0081
6- // Bad.
76enum Enum {
87 P = 3,
9- X = 3,
8+ X = 3, // error!
109 Y = 5,
1110}
1211```
1312
13+ Enum discriminants are used to differentiate enum variants stored in memory.
14+ This error indicates that the same value was used for two or more variants,
15+ making it impossible to distinguish them.
16+
1417```
15- // Good.
1618enum Enum {
1719 P,
18- X = 3,
20+ X = 3, // ok!
1921 Y = 5,
2022}
2123```
@@ -27,7 +29,7 @@ variants.
2729``` compile_fail,E0081
2830enum Bad {
2931 X,
30- Y = 0
32+ Y = 0, // error!
3133}
3234```
3335
You can’t perform that action at this time.
0 commit comments