Skip to content

Commit eaad63a

Browse files
committed
---
yaml --- r: 39036 b: refs/heads/incoming c: a24da7e h: refs/heads/master v: v3
1 parent 3cc58e6 commit eaad63a

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
@@ -6,7 +6,7 @@ refs/heads/try: 3d5418789064fdb463e872a4e651af1c628a3650
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
9-
refs/heads/incoming: e5c9a8a4796d668d20cae1b65e70dd6c2114562a
9+
refs/heads/incoming: a24da7e254110dcd38183e73fa1bb9ef143a6b27
1010
refs/heads/dist-snap: 22efa39382d41b084fde1719df7ae8ce5697d8c9
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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