Skip to content

Commit bdf5865

Browse files
committed
---
yaml --- r: 12259 b: refs/heads/master c: 9ec2193 h: refs/heads/master i: 12257: 164b471 12255: cb465f3 v: v3
1 parent a2bedb2 commit bdf5865

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: efe4c6af23527e19020b707a18597232cb99f2c1
2+
refs/heads/master: 9ec21933f1b730862f85c4dc6a4e46359e84a865
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/doc/tutorial.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,10 +1623,9 @@ The previous section mentioned that arguments are passed by pointer or
16231623
by value based on their type. There is one situation in which this is
16241624
difficult. If you try this program:
16251625

1626-
~~~~
1627-
# fn map(f: fn(int) -> int, v: [int]) {}
1626+
~~~~{.xfail-test}
16281627
fn plus1(x: int) -> int { x + 1 }
1629-
map(plus1, [1, 2, 3]);
1628+
vec::map([1, 2, 3], plus1);
16301629
~~~~
16311630

16321631
You will get an error message about argument passing styles
@@ -1639,9 +1638,8 @@ pass to a generic higher-order function as being passed by pointer,
16391638
using the `&&` sigil:
16401639

16411640
~~~~
1642-
# fn map<T, U>(f: fn(T) -> U, v: [T]) {}
16431641
fn plus1(&&x: int) -> int { x + 1 }
1644-
map(plus1, [1, 2, 3]);
1642+
vec::map([1, 2, 3], plus1);
16451643
~~~~
16461644

16471645
NOTE: This is inconvenient, and we are hoping to get rid of this
@@ -2134,7 +2132,7 @@ native mod crypto {
21342132
}
21352133
21362134
fn as_hex(data: [u8]) -> str {
2137-
let acc = "";
2135+
let mut acc = "";
21382136
for byte in data { acc += #fmt("%02x", byte as uint); }
21392137
ret acc;
21402138
}
@@ -2517,14 +2515,16 @@ The Rust language has a facility for testing built into the language.
25172515
Tests can be interspersed with other code, and annotated with the
25182516
`#[test]` attribute.
25192517

2520-
~~~~
2518+
~~~~{.xfail-test}
2519+
# // FIXME: xfailed because test_twice is a #[test] function it's not
2520+
# // getting compiled
25212521
use std;
25222522
25232523
fn twice(x: int) -> int { x + x }
25242524
25252525
#[test]
25262526
fn test_twice() {
2527-
let i = -100;
2527+
let mut i = -100;
25282528
while i < 100 {
25292529
assert twice(i) == 2 * i;
25302530
i += 1;

0 commit comments

Comments
 (0)