Skip to content

Commit 40c8f47

Browse files
committed
---
yaml --- r: 33087 b: refs/heads/dist-snap c: 8cb3da5 h: refs/heads/master i: 33085: f871450 33083: e460b14 33079: b588583 33071: be46dd8 33055: 444dc0d 33023: c83ac6b v: v3
1 parent d1c485b commit 40c8f47

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: fafce9ae37128f14c890b0805b410527ab81472f
10+
refs/heads/dist-snap: 8cb3da576deb06a7c298761c01708ea90b18659b
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/doc/tutorial.md

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -872,17 +872,6 @@ is optionally followed by an expression to return. A function can
872872
also return a value by having its top level block produce an
873873
expression.
874874

875-
~~~~
876-
# const copernicus: int = 0;
877-
fn int_to_str(i: int) -> ~str {
878-
if i == copernicus {
879-
return ~"tube sock";
880-
} else {
881-
return ~"violin";
882-
}
883-
}
884-
~~~~
885-
886875
~~~~
887876
fn line(a: int, b: int, x: int) -> int {
888877
a*x + b
@@ -1122,7 +1111,7 @@ let x = ~10;
11221111
let y = copy x;
11231112
11241113
let z = *x + *y;
1125-
assert z = 20;
1114+
assert z == 20;
11261115
~~~~
11271116

11281117
This is where the 'move' operator comes in. It is similar to
@@ -1131,7 +1120,7 @@ from `x` to `y`, without violating the constraint that it only has a
11311120
single owner (if you used assignment instead of the move operator, the
11321121
box would, in principle, be copied).
11331122

1134-
~~~~ {.ignore}
1123+
~~~~ {.xfail-test}
11351124
let x = ~10;
11361125
let y = move x;
11371126
@@ -1273,7 +1262,7 @@ also done with square brackets (zero-based):
12731262
# BananaMania, Beaver, Bittersweet };
12741263
# fn draw_scene(c: Crayon) { }
12751264
1276-
let crayons: [Crayon] = [BananaMania, Beaver, Bittersweet];
1265+
let crayons: [Crayon * 3] = [BananaMania, Beaver, Bittersweet];
12771266
match crayons[0] {
12781267
Bittersweet => draw_scene(crayons[0]),
12791268
_ => ()
@@ -1290,7 +1279,7 @@ elements. Mutable vector literals are written `[mut]` (empty) or `[mut
12901279
# Aquamarine, Asparagus, AtomicTangerine,
12911280
# BananaMania, Beaver, Bittersweet };
12921281
1293-
let crayons: [mut Crayon] = [mut BananaMania, Beaver, Bittersweet];
1282+
let crayons: [mut Crayon * 3] = [mut BananaMania, Beaver, Bittersweet];
12941283
crayons[0] = AtomicTangerine;
12951284
~~~~
12961285
@@ -1330,7 +1319,8 @@ Strings are implemented with vectors of `[u8]`, though they have a distinct
13301319
type. They support most of the same allocation options as
13311320
vectors, though the string literal without a storage sigil, e.g.
13321321
`"foo"` is treated differently than a comparable vector (`[foo]`).
1333-
Where
1322+
Wheras plain vectors are stack-allocated fixed length vectors,
1323+
plain strings are region pointers to read-only memory.
13341324
13351325
~~~
13361326
// A plain string is a slice to read-only (static) memory

0 commit comments

Comments
 (0)