Skip to content

Commit 6f3eea5

Browse files
committed
---
yaml --- r: 33203 b: refs/heads/snap-stage3 c: 3d31a6b h: refs/heads/master i: 33201: 679c459 33199: 8dd86cf v: v3
1 parent a097662 commit 6f3eea5

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
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: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: cad6733db5199f35cc64334aa53b635668635931
4+
refs/heads/snap-stage3: 3d31a6b8991005525d55226099d8c8457a0739f6
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/rust.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ There are several kinds of item:
706706
* [functions](#functions)
707707
* [type definitions](#type-definitions)
708708
* [enumerations](#enumerations)
709-
* [resources](#resources)
709+
* [constants](#constants)
710710
* [traits](#traits)
711711
* [implementations](#implementations)
712712

@@ -1151,6 +1151,18 @@ enum list<T> {
11511151
let a: list<int> = cons(7, @cons(13, @nil));
11521152
~~~~
11531153

1154+
### Constants
1155+
1156+
~~~~~~~~ {.ebnf .gram}
1157+
const_item : "const" ident ':' type '=' expr ';' ;
1158+
~~~~~~~~
1159+
1160+
A Constant is a named value stored in read-only memory in a crate.
1161+
The value bound to a constant is evaluated at compile time.
1162+
Constants are declared with the `const` keyword.
1163+
A constant item must have an expression giving its definition.
1164+
The definition expression of a constant is limited to expression forms that can be evaluated at compile time.
1165+
11541166
### Traits
11551167

11561168
A _trait item_ describes a set of method types. [_implementation
@@ -1425,7 +1437,7 @@ statement block. The declared name may denote a new slot or a new item.
14251437

14261438
An _item declaration statement_ has a syntactic form identical to an
14271439
[item](#items) declaration within a module. Declaring an item -- a function,
1428-
enumeration, type, resource, trait, implementation or module -- locally
1440+
enumeration, type, constant, trait, implementation or module -- locally
14291441
within a statement block is simply a way of restricting its scope to a narrow
14301442
region containing all of its uses; it is otherwise identical in meaning to
14311443
declaring the item outside the statement block.
@@ -1629,8 +1641,7 @@ operators, before the expression they apply to.
16291641
`-`
16301642
: Negation. May only be applied to numeric types.
16311643
`*`
1632-
: Dereference. When applied to a [box](#box-types) or
1633-
[resource](#resources) type, it accesses the inner value. For
1644+
: Dereference. When applied to a [pointer](#pointer-types) it denotes the pointed-to location. For
16341645
mutable boxes, the resulting [lvalue](#lvalues-rvalues-and-temporaries) can be assigned to. For
16351646
[enums](#enumerated-types) that have only a single variant,
16361647
containing a single parameter, the dereference operator accesses
@@ -2185,7 +2196,7 @@ fail_expr : "fail" expr ? ;
21852196

21862197
Evaluating a `fail` expression causes a task to enter the *failing* state. In
21872198
the *failing* state, a task unwinds its stack, destroying all frames and
2188-
freeing all resources until it reaches its entry frame, at which point it
2199+
running all destructors until it reaches its entry frame, at which point it
21892200
halts execution in the *dead* state.
21902201

21912202

0 commit comments

Comments
 (0)