Skip to content

Commit 499cf9c

Browse files
committed
---
yaml --- r: 23751 b: refs/heads/master c: 9097410 h: refs/heads/master i: 23749: 6744b4e 23747: dab6b76 23743: 3fb5cc5 v: v3
1 parent e8e4b91 commit 499cf9c

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
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: 0ddae5ec7dc2c1a4237bb091e52fff5940f18b48
2+
refs/heads/master: 9097410b433c0d7c7dca8f9296161b3074a8d21e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/doc/tutorial.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ This code creates a closure that adds a given string to its argument,
13301330
returns it from a function, and then calls it:
13311331

13321332
~~~~
1333-
use std;
1333+
extern mod std;
13341334
13351335
fn mk_appender(suffix: ~str) -> fn@(~str) -> ~str {
13361336
return fn@(s: ~str) -> ~str { s + suffix };
@@ -1680,9 +1680,10 @@ content to the `poultry` module itself.
16801680

16811681
## Using other crates
16821682

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].
16861687

16871688
[std]: http://doc.rust-lang.org/doc/std/index/General.html
16881689

@@ -1738,7 +1739,7 @@ fn world() -> ~str { ~"world" }
17381739

17391740
~~~~ {.ignore}
17401741
// main.rs
1741-
use std;
1742+
extern mod std;
17421743
use mylib;
17431744
fn main() { io::println(~"hello " + mylib::world()); }
17441745
~~~~
@@ -2254,7 +2255,7 @@ Tests can be interspersed with other code, and annotated with the
22542255
~~~~{.xfail-test}
22552256
# // FIXME: xfailed because test_twice is a #[test] function it's not
22562257
# // getting compiled
2257-
use std;
2258+
extern mod std;
22582259
22592260
fn twice(x: int) -> int { x + x }
22602261
@@ -2302,7 +2303,7 @@ To indicate that a test is supposed to fail instead of pass, you can
23022303
give it a `#[should_fail]` attribute.
23032304

23042305
~~~~
2305-
use std;
2306+
extern mod std;
23062307
23072308
fn divide(a: float, b: float) -> float {
23082309
if b == 0f { fail; }

trunk/src/etc/extract-tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
if not ignore:
5252
if not re.search(r"\bfn main\b", block):
5353
block = "fn main() {\n" + block + "\n}\n"
54-
if not re.search(r"\buse std\b", block):
55-
block = "use std;\n" + block;
54+
if not re.search(r"\bextern mod std\b", block):
55+
block = "extern mod std;\n" + block;
5656
if xfail:
5757
block = "// xfail-test\n" + block
5858
filename = (dest + "/" + str(chapter)

0 commit comments

Comments
 (0)