Skip to content

Commit 6d89a4b

Browse files
---
yaml --- r: 234027 b: refs/heads/beta c: 771ab35 h: refs/heads/master i: 234025: 870c2d4 234023: bddf421 v: v3
1 parent d5034c2 commit 6d89a4b

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
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: ec4ba272b00c7a7cae537a73d52f692a1a943e1b
26+
refs/heads/beta: 771ab35c3d3ee684a0d938fe50b1dc21edbca621
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 370fe2786109360f7c35b8ba552b83b773dd71d6
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/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)