]> git.lizzy.rs Git - rust.git/commitdiff
Repair RIMOV damage to doc tests
authorBen Striegel <ben.striegel@gmail.com>
Thu, 31 Jan 2013 05:21:36 +0000 (00:21 -0500)
committerBen Striegel <ben.striegel@gmail.com>
Thu, 31 Jan 2013 05:21:36 +0000 (00:21 -0500)
doc/rust.md
doc/tutorial-tasks.md

index 9982f72ebe722171fd4697e1a72733af7c829e1d..1189e7dbf2252fa9d2e6bbe863e5038a9d90430a 100644 (file)
@@ -1234,7 +1234,7 @@ For example:
 
 ~~~~
 trait Num {
-    static pure fn from_int(n: int) -> self;
+    static pure fn from_int(n: int) -> Self;
 }
 impl float: Num {
     static pure fn from_int(n: int) -> float { n as float }
@@ -1743,7 +1743,6 @@ task in a _failing state_.
 # do task::spawn_unlinked {
 
 ([1, 2, 3, 4])[0];
-(['x', 'y'])[1] = 'z';
 (["a", "b"])[10]; // fails
 
 # }
@@ -1906,8 +1905,8 @@ No allocation or destruction is entailed.
 An example of three different swap expressions:
 
 ~~~~~~~~
-# let mut x = &[0];
-# let mut a = &[0];
+# let mut x = &mut [0];
+# let mut a = &mut [0];
 # let i = 0;
 # let y = {mut z: 0};
 # let b = {mut c: 0};
@@ -2002,7 +2001,7 @@ the unary copy operator is typically only used to cause an argument to a functio
 An example of a copy expression:
 
 ~~~~
-fn mutate(vec: ~[int]) {
+fn mutate(mut vec: ~[int]) {
    vec[0] = 10;
 }
 
index 26541eca7d300a73b054f4b9bd63ce600ee6db7b..98ed6b8658484cc5bf20d7f7e7f65fd93e39dd7f 100644 (file)
@@ -440,8 +440,8 @@ Finally, tasks can be configured to not propagate failure to each
 other at all, using `task::spawn_unlinked` for _isolated failure_.
 
 ~~~
-# fn random() -> int { 100 }
-# fn sleep_for(i: int) { for i.times { task::yield() } }
+# fn random() -> uint { 100 }
+# fn sleep_for(i: uint) { for i.times { task::yield() } }
 # do task::try::<()> {
 let (time1, time2) = (random(), random());
 do task::spawn_unlinked {