File tree 1 file changed +10
-8
lines changed
src/librustc_error_codes/error_codes
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:
4
4
5
5
``` compile_fail,E0081
6
- // Bad.
7
6
enum Enum {
8
7
P = 3,
9
- X = 3,
8
+ X = 3, // error!
10
9
Y = 5,
11
10
}
12
11
```
13
12
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
+
14
17
```
15
- // Good.
16
18
enum Enum {
17
19
P,
18
- X = 3,
20
+ X = 3, // ok!
19
21
Y = 5,
20
22
}
21
23
```
@@ -27,7 +29,7 @@ variants.
27
29
``` compile_fail,E0081
28
30
enum Bad {
29
31
X,
30
- Y = 0
32
+ Y = 0, // error!
31
33
}
32
34
```
33
35
You can’t perform that action at this time.
0 commit comments