Skip to content

Commit 7e2a638

Browse files
committed
---
yaml --- r: 33759 b: refs/heads/snap-stage3 c: a24da7e h: refs/heads/master i: 33757: dc1b03a 33755: a4a371a 33751: 1c5c10f 33743: 8153a79 33727: 3e5ab6d v: v3
1 parent 59072fe commit 7e2a638

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
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: e5c9a8a4796d668d20cae1b65e70dd6c2114562a
4+
refs/heads/snap-stage3: a24da7e254110dcd38183e73fa1bb9ef143a6b27
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: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,17 @@ Constants are declared with the `const` keyword.
11041104
A constant item must have an expression giving its definition.
11051105
The definition expression of a constant is limited to expression forms that can be evaluated at compile time.
11061106

1107+
Constants must be explicitly typed. The type may be ```bool```, ```char```, a number, or a type derived from
1108+
those primitive types. The derived types are borrowed pointers, static arrays, tuples, and structs.
1109+
1110+
~~~~
1111+
const bit1: uint = 1 << 0;
1112+
const bit2: uint = 1 << 1;
1113+
1114+
const bits: [uint * 2] = [bit1, bit2];
1115+
const bits_r: &[uint] = &bits;
1116+
~~~~
1117+
11071118
### Traits
11081119

11091120
A _trait_ describes a set of method types.
@@ -1562,7 +1573,6 @@ indicate that the elements of the resulting vector may be mutated.
15621573
When no mutability is specified, the vector is immutable.
15631574

15641575
~~~~
1565-
[]
15661576
[1, 2, 3, 4];
15671577
["a", "b", "c", "d"];
15681578
[0, ..128]; // vector with 128 zeros

0 commit comments

Comments
 (0)