Skip to content

Commit c2e4c65

Browse files
committed
---
yaml --- r: 35815 b: refs/heads/try2 c: 3d31a6b h: refs/heads/master i: 35813: f5843d8 35811: 936a2cc 35807: d4e3d01 v: v3
1 parent a44157a commit c2e4c65

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
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: cad6733db5199f35cc64334aa53b635668635931
8+
refs/heads/try2: 3d31a6b8991005525d55226099d8c8457a0739f6
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

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