Skip to content

Commit 7d611fc

Browse files
Add back the E0020 error code long explanation
1 parent 4543ce6 commit 7d611fc

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/librustc_error_codes/error_codes.rs

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ E0016: include_str!("./error_codes/E0016.md"),
2525
E0017: include_str!("./error_codes/E0017.md"),
2626
E0018: include_str!("./error_codes/E0018.md"),
2727
E0019: include_str!("./error_codes/E0019.md"),
28+
E0020: include_str!("./error_codes/E0020.md"),
2829
E0022: include_str!("./error_codes/E0022.md"),
2930
E0023: include_str!("./error_codes/E0023.md"),
3031
E0025: include_str!("./error_codes/E0025.md"),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#### Note: this error code is no longer emitted by the compiler.
2+
3+
This error indicates that an attempt was made to divide by zero (or take the
4+
remainder of a zero divisor) in a static or constant expression. Erroneous
5+
code example:
6+
7+
```compile_fail
8+
#[deny(const_err)]
9+
10+
const X: i32 = 42 / 0;
11+
// error: attempt to divide by zero in a constant expression
12+
```

0 commit comments

Comments
 (0)