Skip to content

Commit aa9c28e

Browse files
committed
Repair RIMOV damage to doc tests
1 parent 9330b2f commit aa9c28e

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

doc/rust.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ For example:
12341234

12351235
~~~~
12361236
trait Num {
1237-
static pure fn from_int(n: int) -> self;
1237+
static pure fn from_int(n: int) -> Self;
12381238
}
12391239
impl float: Num {
12401240
static pure fn from_int(n: int) -> float { n as float }
@@ -1743,7 +1743,6 @@ task in a _failing state_.
17431743
# do task::spawn_unlinked {
17441744
17451745
([1, 2, 3, 4])[0];
1746-
(['x', 'y'])[1] = 'z';
17471746
(["a", "b"])[10]; // fails
17481747
17491748
# }
@@ -1906,8 +1905,8 @@ No allocation or destruction is entailed.
19061905
An example of three different swap expressions:
19071906

19081907
~~~~~~~~
1909-
# let mut x = &[0];
1910-
# let mut a = &[0];
1908+
# let mut x = &mut [0];
1909+
# let mut a = &mut [0];
19111910
# let i = 0;
19121911
# let y = {mut z: 0};
19131912
# let b = {mut c: 0};
@@ -2002,7 +2001,7 @@ the unary copy operator is typically only used to cause an argument to a functio
20022001
An example of a copy expression:
20032002

20042003
~~~~
2005-
fn mutate(vec: ~[int]) {
2004+
fn mutate(mut vec: ~[int]) {
20062005
vec[0] = 10;
20072006
}
20082007

doc/tutorial-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,8 @@ Finally, tasks can be configured to not propagate failure to each
440440
other at all, using `task::spawn_unlinked` for _isolated failure_.
441441

442442
~~~
443-
# fn random() -> int { 100 }
444-
# fn sleep_for(i: int) { for i.times { task::yield() } }
443+
# fn random() -> uint { 100 }
444+
# fn sleep_for(i: uint) { for i.times { task::yield() } }
445445
# do task::try::<()> {
446446
let (time1, time2) = (random(), random());
447447
do task::spawn_unlinked {

0 commit comments

Comments
 (0)