@@ -1330,7 +1330,7 @@ This code creates a closure that adds a given string to its argument,
1330
1330
returns it from a function, and then calls it:
1331
1331
1332
1332
~~~~
1333
- use std;
1333
+ extern mod std;
1334
1334
1335
1335
fn mk_appender(suffix: ~str) -> fn@(~str) -> ~str {
1336
1336
return fn@(s: ~str) -> ~str { s + suffix };
@@ -1680,9 +1680,10 @@ content to the `poultry` module itself.
1680
1680
1681
1681
## Using other crates
1682
1682
1683
- Having compiled a crate that contains the ` #[crate_type = "lib"] ` attribute,
1684
- you can use it in another crate with a ` use ` directive. We've already seen
1685
- ` use std ` in several of the examples, which loads in the [ standard library] [ std ] .
1683
+ Having compiled a crate that contains the ` #[crate_type = "lib"] `
1684
+ attribute, you can use it in another crate with a ` use `
1685
+ directive. We've already seen ` extern mod std ` in several of the
1686
+ examples, which loads in the [ standard library] [ std ] .
1686
1687
1687
1688
[ std ] : http://doc.rust-lang.org/doc/std/index/General.html
1688
1689
@@ -1738,7 +1739,7 @@ fn world() -> ~str { ~"world" }
1738
1739
1739
1740
~~~~ {.ignore}
1740
1741
// main.rs
1741
- use std;
1742
+ extern mod std;
1742
1743
use mylib;
1743
1744
fn main() { io::println(~"hello " + mylib::world()); }
1744
1745
~~~~
@@ -2254,7 +2255,7 @@ Tests can be interspersed with other code, and annotated with the
2254
2255
~~~~ {.xfail-test}
2255
2256
# // FIXME: xfailed because test_twice is a #[test] function it's not
2256
2257
# // getting compiled
2257
- use std;
2258
+ extern mod std;
2258
2259
2259
2260
fn twice(x: int) -> int { x + x }
2260
2261
@@ -2302,7 +2303,7 @@ To indicate that a test is supposed to fail instead of pass, you can
2302
2303
give it a ` #[should_fail] ` attribute.
2303
2304
2304
2305
~~~~
2305
- use std;
2306
+ extern mod std;
2306
2307
2307
2308
fn divide(a: float, b: float) -> float {
2308
2309
if b == 0f { fail; }
0 commit comments