File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
branches/stable/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 @@ -29,6 +29,6 @@ refs/heads/tmp: e5d90d98402475b6e154ce216f9efcb80da1a747
29
29
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
30
30
refs/tags/homu-tmp: 1fe32ca12c51afcd761d9962f51a74ff0d07a591
31
31
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828
32
- refs/heads/stable: 8c5572fc2114fa2e8156c89cda89c799c9c3e9e0
32
+ refs/heads/stable: 6471dccd3b3a5b83b4fccecffc94047e1086ca2f
33
33
refs/tags/1.0.0: 55bd4f8ff2b323f317ae89e254ce87162d52a375
34
34
refs/tags/1.1.0: bc3c16f09287e5545c1d3f76b7abd54f2eca868b
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