Skip to content

Commit 852d7da

Browse files
Add back the E0016 error code long explanation
1 parent 75852dd commit 852d7da

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/librustc_error_codes/error_codes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ E0011: include_str!("./error_codes/E0011.md"),
2121
E0013: include_str!("./error_codes/E0013.md"),
2222
E0014: include_str!("./error_codes/E0014.md"),
2323
E0015: include_str!("./error_codes/E0015.md"),
24+
E0016: include_str!("./error_codes/E0016.md"),
2425
E0017: include_str!("./error_codes/E0017.md"),
2526
E0019: include_str!("./error_codes/E0019.md"),
2627
E0023: include_str!("./error_codes/E0023.md"),
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#### Note: this error code is no longer emitted by the compiler.
2+
3+
Blocks in constants may only contain items (such as constant, function
4+
definition, etc...) and a tail expression. Erroneous code example:
5+
6+
```
7+
const FOO: i32 = { let x = 0; x }; // 'x' isn't an item!
8+
```
9+
10+
To avoid it, you have to replace the non-item object:
11+
12+
```
13+
const FOO: i32 = { const X : i32 = 0; X };
14+
```

0 commit comments

Comments
 (0)