Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup error code #66808

Merged
merged 3 commits into from
Nov 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/librustc_error_codes/error_codes/E0080.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
This error indicates that the compiler was unable to sensibly evaluate a
constant expression that had to be evaluated. Attempting to divide by 0
or causing integer overflow are two ways to induce this error. For example:
A constant value failed to get evaluated.

Erroneous code example:

```compile_fail,E0080
enum Enum {
X = (1 << 500),
Y = (1 / 0)
Y = (1 / 0),
}
```

This error indicates that the compiler was unable to sensibly evaluate a
constant expression that had to be evaluated. Attempting to divide by 0
or causing an integer overflow are two ways to induce this error.

Ensure that the expressions given can be evaluated as the desired integer type.
See the FFI section of the Reference for more information about using a custom
integer type:
Expand Down
18 changes: 10 additions & 8 deletions src/librustc_error_codes/error_codes/E0081.md
Original file line number Diff line number Diff line change
@@ -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,
}
```
Expand All @@ -27,7 +29,7 @@ variants.
```compile_fail,E0081
enum Bad {
X,
Y = 0
Y = 0, // error!
}
```

Expand Down
5 changes: 3 additions & 2 deletions src/librustc_error_codes/error_codes/E0091.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
You gave an unnecessary type or const parameter in a type alias. Erroneous
code example:
An unnecessary type or const parameter was given in a type alias.

Erroneous code example:

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