Skip to content

Commit f774cdf

Browse files
committed
---
yaml --- r: 36371 b: refs/heads/try2 c: a24da7e h: refs/heads/master i: 36369: b4f54e5 36367: 60f2294 v: v3
1 parent 4cd806f commit f774cdf

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
@@ -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: e5c9a8a4796d668d20cae1b65e70dd6c2114562a
8+
refs/heads/try2: a24da7e254110dcd38183e73fa1bb9ef143a6b27
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: 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)