File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
branches/try/src/librustc Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: aca2057ed5fb7af3f8905b2bc01f72fa001c35c8
3
3
refs/heads/snap-stage3: 1af31d4974e33027a68126fa5a5a3c2c6491824f
4
- refs/heads/try: 8c5572fc2114fa2e8156c89cda89c799c9c3e9e0
4
+ refs/heads/try: 6471dccd3b3a5b83b4fccecffc94047e1086ca2f
5
5
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
6
6
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
7
7
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -256,6 +256,21 @@ See [RFC 911] for more details on the design of `const fn`s.
256
256
[RFC 911]: https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md
257
257
"## ,
258
258
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
+
259
274
E0018 : r##"
260
275
The value of static and const variables must be known at compile time. You
261
276
can't cast a pointer as an integer because we can't know what value the
You can’t perform that action at this time.
0 commit comments