Skip to content

Commit

Permalink
Clean up E0080 long explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Nov 27, 2019
1 parent 4eee955 commit 38f9cd4
Showing 1 changed file with 8 additions and 4 deletions.
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

0 comments on commit 38f9cd4

Please sign in to comment.