Skip to content

Commit cc04288

Browse files
---
yaml --- r: 231791 b: refs/heads/auto c: 771ab35 h: refs/heads/master i: 231789: 40df3cd 231787: 7ea3b7c 231783: 3074f4b 231775: 26e00ac v: v3
1 parent b3c3a49 commit cc04288

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: ec4ba272b00c7a7cae537a73d52f692a1a943e1b
11+
refs/heads/auto: 771ab35c3d3ee684a0d938fe50b1dc21edbca621
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc/diagnostics.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,14 @@ match x {
218218
E0010: r##"
219219
The value of statics and constants must be known at compile time, and they live
220220
for the entire lifetime of a program. Creating a boxed value allocates memory on
221-
the heap at runtime, and therefore cannot be done at compile time.
221+
the heap at runtime, and therefore cannot be done at compile time. Erroneous
222+
code example:
223+
224+
```
225+
#![feature(box_syntax)]
226+
227+
const CON : Box<i32> = box 0;
228+
```
222229
"##,
223230

224231
E0011: r##"
@@ -335,7 +342,6 @@ is not allowed.
335342
336343
If you really want global mutable state, try using `static mut` or a global
337344
`UnsafeCell`.
338-
339345
"##,
340346

341347
E0018: r##"
@@ -399,7 +405,13 @@ fn main() {
399405

400406
E0020: r##"
401407
This error indicates that an attempt was made to divide by zero (or take the
402-
remainder of a zero divisor) in a static or constant expression.
408+
remainder of a zero divisor) in a static or constant expression. Erroneous
409+
code example:
410+
411+
```
412+
const X: i32 = 42 / 0;
413+
// error: attempted to divide by zero in a constant expression
414+
```
403415
"##,
404416

405417
E0022: r##"

0 commit comments

Comments
 (0)