Skip to content

Commit 45eacba

Browse files
authored
Rollup merge of #66808 - GuillaumeGomez:cleanup-err-code-3, r=Dylan-DPC
Cleanup error code r? @Dylan-DPC
2 parents d54acc1 + 7edaeba commit 45eacba

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

src/librustc_error_codes/error_codes/E0080.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1-
This error indicates that the compiler was unable to sensibly evaluate a
2-
constant expression that had to be evaluated. Attempting to divide by 0
3-
or causing integer overflow are two ways to induce this error. For example:
1+
A constant value failed to get evaluated.
2+
3+
Erroneous code example:
44

55
```compile_fail,E0080
66
enum Enum {
77
X = (1 << 500),
8-
Y = (1 / 0)
8+
Y = (1 / 0),
99
}
1010
```
1111

12+
This error indicates that the compiler was unable to sensibly evaluate a
13+
constant expression that had to be evaluated. Attempting to divide by 0
14+
or causing an integer overflow are two ways to induce this error.
15+
1216
Ensure that the expressions given can be evaluated as the desired integer type.
1317
See the FFI section of the Reference for more information about using a custom
1418
integer type:

src/librustc_error_codes/error_codes/E0081.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
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.
76
enum 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.
1618
enum Enum {
1719
P,
18-
X = 3,
20+
X = 3, // ok!
1921
Y = 5,
2022
}
2123
```
@@ -27,7 +29,7 @@ variants.
2729
```compile_fail,E0081
2830
enum Bad {
2931
X,
30-
Y = 0
32+
Y = 0, // error!
3133
}
3234
```
3335

src/librustc_error_codes/error_codes/E0091.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
You gave an unnecessary type or const parameter in a type alias. Erroneous
2-
code example:
1+
An unnecessary type or const parameter was given in a type alias.
2+
3+
Erroneous code example:
34

45
```compile_fail,E0091
56
type Foo<T> = u32; // error: type parameter `T` is unused

0 commit comments

Comments
 (0)