Skip to content

Commit 1d75250

Browse files
---
yaml --- r: 227641 b: refs/heads/try c: 6471dcc h: refs/heads/master i: 227639: d69a2d8 v: v3
1 parent 47a10d2 commit 1d75250

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
33
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4-
refs/heads/try: 8c5572fc2114fa2e8156c89cda89c799c9c3e9e0
4+
refs/heads/try: 6471dccd3b3a5b83b4fccecffc94047e1086ca2f
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/librustc/diagnostics.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,21 @@ See [RFC 911] for more details on the design of `const fn`s.
256256
[RFC 911]: https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md
257257
"##,
258258

259+
E0016: r##"
260+
Blocks in constants may only contain items (such as constant, function
261+
definition, etc...) and a tail expression. Example:
262+
263+
```
264+
const FOO: i32 = { let x = 0; x }; // 'x' isn't an item!
265+
```
266+
267+
To avoid it, you have to replace the non-item object:
268+
269+
```
270+
const FOO: i32 = { const X : i32 = 0; X };
271+
```
272+
"##,
273+
259274
E0018: r##"
260275
The value of static and const variables must be known at compile time. You
261276
can't cast a pointer as an integer because we can't know what value the

0 commit comments

Comments
 (0)