auto merge of #12272 : alexcrichton/rust/snapshot, r=kballard
This notably contains the `extern mod` => `extern crate` change. Closes #9880
This commit is contained in:
commit
6b025c803c
444 changed files with 694 additions and 718 deletions
|
@ -13,8 +13,8 @@
|
|||
#[allow(non_camel_case_types)];
|
||||
#[deny(warnings)];
|
||||
|
||||
extern mod extra;
|
||||
extern mod getopts;
|
||||
extern crate extra;
|
||||
extern crate getopts;
|
||||
|
||||
use std::os;
|
||||
use std::io;
|
||||
|
|
|
@ -1 +1 @@
|
|||
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico" />
|
||||
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico" />
|
||||
|
|
|
@ -232,7 +232,7 @@ fn main() {}
|
|||
Whereas this program explicitly opts into using a particular runtime
|
||||
|
||||
~~~{.rust}
|
||||
extern mod green;
|
||||
extern crate green;
|
||||
|
||||
#[start]
|
||||
fn start(argc: int, argv: **u8) -> int {
|
||||
|
|
|
@ -285,7 +285,7 @@ later.
|
|||
The basic example below illustrates this.
|
||||
|
||||
~~~
|
||||
# extern mod sync;
|
||||
# extern crate sync;
|
||||
|
||||
# fn main() {
|
||||
# fn make_a_sandwich() {};
|
||||
|
@ -310,7 +310,7 @@ Here is another example showing how futures allow you to background computations
|
|||
be distributed on the available cores.
|
||||
|
||||
~~~
|
||||
# extern mod sync;
|
||||
# extern crate sync;
|
||||
# use std::vec;
|
||||
fn partial_sum(start: uint) -> f64 {
|
||||
let mut local_sum = 0f64;
|
||||
|
@ -346,7 +346,7 @@ Here is a small example showing how to use Arcs. We wish to run concurrently sev
|
|||
a single large vector of floats. Each task needs the full vector to perform its duty.
|
||||
|
||||
~~~
|
||||
# extern mod sync;
|
||||
# extern crate sync;
|
||||
# use std::vec;
|
||||
# use std::rand;
|
||||
use sync::Arc;
|
||||
|
@ -379,7 +379,7 @@ at the power given as argument and takes the inverse power of this value). The A
|
|||
created by the line
|
||||
|
||||
~~~
|
||||
# extern mod sync;
|
||||
# extern crate sync;
|
||||
# use sync::Arc;
|
||||
# use std::vec;
|
||||
# use std::rand;
|
||||
|
@ -392,7 +392,7 @@ let numbers_arc=Arc::new(numbers);
|
|||
and a clone of it is sent to each task
|
||||
|
||||
~~~
|
||||
# extern mod sync;
|
||||
# extern crate sync;
|
||||
# use sync::Arc;
|
||||
# use std::vec;
|
||||
# use std::rand;
|
||||
|
@ -409,7 +409,7 @@ copying only the wrapper and not its contents.
|
|||
Each task recovers the underlying data by
|
||||
|
||||
~~~
|
||||
# extern mod sync;
|
||||
# extern crate sync;
|
||||
# use sync::Arc;
|
||||
# use std::vec;
|
||||
# use std::rand;
|
||||
|
@ -499,7 +499,7 @@ the string in response. The child terminates when it receives `0`.
|
|||
Here is the function that implements the child task:
|
||||
|
||||
~~~
|
||||
# extern mod sync;
|
||||
# extern crate sync;
|
||||
# fn main() {
|
||||
# use sync::DuplexStream;
|
||||
fn stringifier(channel: &DuplexStream<~str, uint>) {
|
||||
|
@ -524,7 +524,7 @@ response itself is simply the stringified version of the received value,
|
|||
Here is the code for the parent task:
|
||||
|
||||
~~~
|
||||
# extern mod sync;
|
||||
# extern crate sync;
|
||||
# use std::task::spawn;
|
||||
# use sync::DuplexStream;
|
||||
# fn stringifier(channel: &DuplexStream<~str, uint>) {
|
||||
|
|
|
@ -185,7 +185,7 @@ amount.
|
|||
For example:
|
||||
|
||||
~~~
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
use std::vec;
|
||||
use extra::test::BenchHarness;
|
||||
|
||||
|
@ -243,7 +243,7 @@ recognize that some calculation has no external effects and remove
|
|||
it entirely.
|
||||
|
||||
~~~
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
use extra::test::BenchHarness;
|
||||
|
||||
#[bench]
|
||||
|
|
|
@ -273,7 +273,7 @@ msgstr "## タプル"
|
|||
#. type: Plain text
|
||||
#: src/doc/complement-cheatsheet.md:122
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~\n"
|
||||
"struct Foo {\n"
|
||||
|
@ -282,7 +282,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
|
|
@ -79,13 +79,13 @@ msgstr "# 関数"
|
|||
#: src/doc/guide-conditions.md:262
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello "
|
||||
#| "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello "
|
||||
#| "\" + world::explore()); } ~~~~"
|
||||
msgid "fn main() {"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
|
|
@ -74,7 +74,7 @@ msgstr "# イントロダクション"
|
|||
#. type: Plain text
|
||||
#: src/doc/guide-container.md:85
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"impl Iterator<int> for ZeroStream {\n"
|
||||
" fn next(&mut self) -> Option<int> {\n"
|
||||
|
@ -85,7 +85,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ msgstr "## 最小限の例"
|
|||
#. type: Plain text
|
||||
#: src/doc/guide-ffi.md:323
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"struct RustObject {\n"
|
||||
" a: i32,\n"
|
||||
|
@ -79,7 +79,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
|
|
@ -154,7 +154,7 @@ msgstr ""
|
|||
#: src/doc/guide-pointers.md:141 src/doc/guide-pointers.md:221
|
||||
#: src/doc/guide-pointers.md:238 src/doc/guide-pointers.md:300
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~rust\n"
|
||||
"struct Point {\n"
|
||||
|
@ -164,7 +164,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -222,7 +222,7 @@ msgstr "# データ構造"
|
|||
#. type: Plain text
|
||||
#: src/doc/guide-pointers.md:189
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~rust\n"
|
||||
"enum List<T> {\n"
|
||||
|
@ -232,7 +232,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -304,7 +304,7 @@ msgstr "## マネージドボックス"
|
|||
#. type: Plain text
|
||||
#: src/doc/guide-pointers.md:269
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~rust{.ignore}\n"
|
||||
"struct Point {\n"
|
||||
|
@ -314,7 +314,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -372,7 +372,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/guide-pointers.md:341
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"struct Point {\n"
|
||||
" x: f32,\n"
|
||||
|
@ -381,7 +381,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -402,7 +402,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/guide-pointers.md:378
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~rust{.ignore}\n"
|
||||
"fn main() {\n"
|
||||
|
@ -413,7 +413,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -499,7 +499,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/guide-pointers.md:450
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" let x = ~5;\n"
|
||||
|
@ -509,7 +509,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -530,7 +530,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/guide-pointers.md:463
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" let x = ~5;\n"
|
||||
|
@ -540,14 +540,14 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/guide-pointers.md:477
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" let x = ~5;\n"
|
||||
|
@ -557,7 +557,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
|
|
@ -83,13 +83,13 @@ msgstr "## 他のクレートの利用"
|
|||
#: src/doc/guide-runtime.md:231
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello "
|
||||
#| "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello "
|
||||
#| "\" + world::explore()); } ~~~~"
|
||||
msgid "~~~{.rust} fn main() {} ~~~"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -97,7 +97,7 @@ msgstr ""
|
|||
#: src/doc/guide-runtime.md:236
|
||||
#, fuzzy
|
||||
#| msgid "~~~~ {.ignore} let foo = 10;"
|
||||
msgid "~~~{.rust} extern mod green;"
|
||||
msgid "~~~{.rust} extern crate green;"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"let foo = 10;"
|
||||
|
@ -106,13 +106,13 @@ msgstr ""
|
|||
#: src/doc/guide-runtime.md:246
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello "
|
||||
#| "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello "
|
||||
#| "\" + world::explore()); } ~~~~"
|
||||
msgid "fn main() {} ~~~"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ msgstr "## 最小限の例"
|
|||
#: src/doc/guide-testing.md:131
|
||||
#, fuzzy
|
||||
#| msgid "~~~~ use std::task::spawn;"
|
||||
msgid "~~~ extern mod extra; use std::vec;"
|
||||
msgid "~~~ extern crate extra; use std::vec;"
|
||||
msgstr ""
|
||||
"~~~~\n"
|
||||
"use std::task::spawn;"
|
||||
|
|
|
@ -310,14 +310,14 @@ msgstr "## 他のクレートの利用"
|
|||
#: src/doc/rust.md:786
|
||||
#, fuzzy
|
||||
#| msgid "## Using other crates"
|
||||
msgid "Four examples of `extern mod` declarations:"
|
||||
msgid "Four examples of `extern crate` declarations:"
|
||||
msgstr "## 他のクレートの利用"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/rust.md:789
|
||||
#, fuzzy
|
||||
#| msgid "~~~~ {.ignore} let foo = 10;"
|
||||
msgid "~~~~ {.ignore} extern mod pcre;"
|
||||
msgid "~~~~ {.ignore} extern crate pcre;"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"let foo = 10;"
|
||||
|
@ -365,7 +365,7 @@ msgstr "## 最小限の例"
|
|||
#| msgid "~~~~ {.ignore} let foo = 10;"
|
||||
msgid ""
|
||||
"mod foo {\n"
|
||||
" extern mod extra;\n"
|
||||
" extern crate extra;\n"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"let foo = 10;"
|
||||
|
@ -374,13 +374,13 @@ msgstr ""
|
|||
#: src/doc/rust.md:901
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello "
|
||||
#| "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello "
|
||||
#| "\" + world::explore()); } ~~~~"
|
||||
msgid "fn main() {} ~~~~"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -751,7 +751,7 @@ msgstr "# イントロダクション"
|
|||
#. type: Plain text
|
||||
#: src/doc/rust.md:1420
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"struct Circle {\n"
|
||||
" radius: f64,\n"
|
||||
|
@ -760,7 +760,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -775,13 +775,13 @@ msgstr "## 本書の表記について"
|
|||
#: src/doc/rust.md:1644 src/doc/rust.md:1665
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello "
|
||||
#| "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello "
|
||||
#| "\" + world::explore()); } ~~~~"
|
||||
msgid "# fn main() {} ~~~~"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -866,7 +866,7 @@ msgstr "## 凍結"
|
|||
#. type: Plain text
|
||||
#: src/doc/rust.md:1953
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~~\n"
|
||||
"#[deriving(Eq, Clone)]\n"
|
||||
|
@ -878,7 +878,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -1254,7 +1254,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/rust.md:2702
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"while i < 10 {\n"
|
||||
" println!(\"hello\");\n"
|
||||
|
@ -1264,7 +1264,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -1306,7 +1306,7 @@ msgstr "## 最小限の例"
|
|||
#. type: Plain text
|
||||
#: src/doc/rust.md:2774
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"for e in v.iter() {\n"
|
||||
" bar(*e);\n"
|
||||
|
@ -1315,7 +1315,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -1637,7 +1637,7 @@ msgstr "## 最小限の例"
|
|||
#. type: Plain text
|
||||
#: src/doc/rust.md:3314
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~~\n"
|
||||
"trait Printable {\n"
|
||||
|
@ -1646,14 +1646,14 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/rust.md:3318
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"impl Printable for int {\n"
|
||||
" fn to_string(&self) -> ~str { self.to_str() }\n"
|
||||
|
@ -1661,14 +1661,14 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/rust.md:3327
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" print(@10 as @Printable);\n"
|
||||
|
@ -1677,7 +1677,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -1698,7 +1698,7 @@ msgstr "# クロージャ"
|
|||
#. type: Plain text
|
||||
#: src/doc/rust.md:3359
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~~\n"
|
||||
"trait Printable {\n"
|
||||
|
@ -1707,14 +1707,14 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/rust.md:3366
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"impl Printable for ~str {\n"
|
||||
" fn make_string(&self) -> ~str {\n"
|
||||
|
@ -1725,7 +1725,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
|
|
@ -431,7 +431,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:136
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~~\n"
|
||||
"fn main() {\n"
|
||||
|
@ -441,7 +441,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -634,7 +634,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:222
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"while count < 10 {\n"
|
||||
" println!(\"count is {}\", count);\n"
|
||||
|
@ -644,7 +644,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -1413,7 +1413,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:602
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~~\n"
|
||||
"struct Point {\n"
|
||||
|
@ -1424,7 +1424,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -2187,7 +2187,7 @@ msgstr "# ボックス"
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:986
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"struct Foo {\n"
|
||||
" a: u32,\n"
|
||||
|
@ -2198,7 +2198,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -2312,7 +2312,7 @@ msgstr "例として、シンプルな構造体型の `Point` について考え
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:1376
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~\n"
|
||||
"struct Point {\n"
|
||||
|
@ -2323,7 +2323,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -3688,7 +3688,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2110
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~\n"
|
||||
"struct TimeBomb {\n"
|
||||
|
@ -3697,7 +3697,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -3735,7 +3735,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2135
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~~\n"
|
||||
"trait Printable {\n"
|
||||
|
@ -3745,7 +3745,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -3774,7 +3774,7 @@ msgstr "[impls]: #メソッド"
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2160 src/doc/tutorial.md:2206
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"impl Printable for ~str {\n"
|
||||
" fn print(&self) { println!(\"{}\", *self) }\n"
|
||||
|
@ -3782,7 +3782,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -3821,7 +3821,7 @@ msgstr "## トレイトの実装の導出"
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2185
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"impl Printable for bool {\n"
|
||||
" fn print(&self) { println!(\"{:?}\", *self) }\n"
|
||||
|
@ -3829,7 +3829,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -3864,7 +3864,7 @@ msgstr "## タプル"
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2235
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~~\n"
|
||||
"trait Seq<T> {\n"
|
||||
|
@ -3873,14 +3873,14 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2240
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"impl<T> Seq<T> for ~[T] {\n"
|
||||
" fn length(&self) -> uint { self.len() }\n"
|
||||
|
@ -3889,7 +3889,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4447,7 +4447,7 @@ msgstr "## クレート"
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2554
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~~\n"
|
||||
"// `main.rs`\n"
|
||||
|
@ -4458,7 +4458,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4487,7 +4487,7 @@ msgstr "## 標準ライブラリ"
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2587
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" println!(\"Hello farm!\");\n"
|
||||
|
@ -4496,7 +4496,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4510,21 +4510,21 @@ msgstr "## マネージドクロージャ"
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2607
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" println!(\"Hello chicken!\");\n"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2639
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" println!(\"Hello chicken!\");\n"
|
||||
|
@ -4534,7 +4534,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4573,7 +4573,7 @@ msgstr "# モジュールとクレート"
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2719
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" println!(\"Hello farm!\");\n"
|
||||
|
@ -4583,7 +4583,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4653,34 +4653,34 @@ msgstr ""
|
|||
#: src/doc/tutorial.md:2897
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello "
|
||||
#| "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello "
|
||||
#| "\" + world::explore()); } ~~~~"
|
||||
msgid "fn main() { cow() } ~~~"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2916
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" println!(\"Hello farm!\");\n"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2923
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
" // Can now refer to those names directly:\n"
|
||||
" chicken();\n"
|
||||
|
@ -4691,7 +4691,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4699,7 +4699,7 @@ msgstr ""
|
|||
#: src/doc/tutorial.md:2932
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello "
|
||||
#| "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello "
|
||||
#| "\" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~{.ignore} // `a.rs` - crate root use b::foo; mod b; fn main() { foo(); } "
|
||||
|
@ -4707,7 +4707,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4715,21 +4715,21 @@ msgstr ""
|
|||
#: src/doc/tutorial.md:2939
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello "
|
||||
#| "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello "
|
||||
#| "\" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~{.ignore} // `b.rs` use b::c::bar; pub mod c; pub fn foo() { bar(); } ~~~"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:2985
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" egg_layer();\n"
|
||||
|
@ -4738,7 +4738,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4752,7 +4752,7 @@ msgstr "# ポインタのデリファレンス"
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:3014
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" farm::chicken();\n"
|
||||
|
@ -4763,7 +4763,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4778,13 +4778,13 @@ msgstr "## 他のクレートの利用"
|
|||
#: src/doc/tutorial.md:3035
|
||||
#, fuzzy
|
||||
#| msgid "## Using other crates"
|
||||
msgid "For that, Rust offers you the `extern mod` declaration:"
|
||||
msgid "For that, Rust offers you the `extern crate` declaration:"
|
||||
msgstr "## 他のクレートの利用"
|
||||
|
||||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:3045
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" // The rational number '1/2':\n"
|
||||
|
@ -4794,7 +4794,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4802,7 +4802,7 @@ msgstr ""
|
|||
#: src/doc/tutorial.md:3068
|
||||
#, fuzzy
|
||||
#| msgid "~~~~ {.ignore} let foo = 10;"
|
||||
msgid "~~~ extern mod extra;"
|
||||
msgid "~~~ extern crate extra;"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"let foo = 10;"
|
||||
|
@ -4810,7 +4810,7 @@ msgstr ""
|
|||
#. type: Plain text
|
||||
#: src/doc/tutorial.md:3081
|
||||
#, fuzzy, no-wrap
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
#| msgid "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello \" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"fn main() {\n"
|
||||
" farm::dog();\n"
|
||||
|
@ -4820,7 +4820,7 @@ msgid ""
|
|||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4835,17 +4835,17 @@ msgstr "## 構造体"
|
|||
#: src/doc/tutorial.md:3123
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} extern mod farm; extern mod my_farm (name = \"farm\", vers "
|
||||
#| "= \"2.5\"); extern mod my_auxiliary_farm (name = \"farm\", author = \"mjh"
|
||||
#| "~~~~ {.ignore} extern crate farm; extern crate my_farm (name = \"farm\", vers "
|
||||
#| "= \"2.5\"); extern crate my_auxiliary_farm (name = \"farm\", author = \"mjh"
|
||||
#| "\"); ~~~~"
|
||||
msgid ""
|
||||
"~~~~ {.ignore} extern mod farm; extern mod farm = \"farm#2.5\"; extern mod "
|
||||
"~~~~ {.ignore} extern crate farm; extern crate farm = \"farm#2.5\"; extern crate "
|
||||
"my_farm = \"farm\"; ~~~~"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"extern mod farm;\n"
|
||||
"extern mod my_farm (name = \"farm\", vers = \"2.5\");\n"
|
||||
"extern mod my_auxiliary_farm (name = \"farm\", author = \"mjh\");\n"
|
||||
"extern crate farm;\n"
|
||||
"extern crate my_farm (name = \"farm\", vers = \"2.5\");\n"
|
||||
"extern crate my_auxiliary_farm (name = \"farm\", author = \"mjh\");\n"
|
||||
"~~~~"
|
||||
|
||||
#. type: Plain text
|
||||
|
@ -4891,7 +4891,7 @@ msgstr ""
|
|||
#| "~~~~ // world.rs #[link(name = \"world\", vers = \"1.0\")]; pub fn "
|
||||
#| "explore() -> &str { \"world\" } ~~~~"
|
||||
msgid ""
|
||||
"~~~~ // `world.rs` #[crate_id = \"world#0.42\"]; # extern mod extra; pub fn "
|
||||
"~~~~ // `world.rs` #[crate_id = \"world#0.42\"]; # extern crate extra; pub fn "
|
||||
"explore() -> &'static str { \"world\" } # fn main() {} ~~~~"
|
||||
msgstr ""
|
||||
"~~~~\n"
|
||||
|
@ -4904,15 +4904,15 @@ msgstr ""
|
|||
#: src/doc/tutorial.md:3159
|
||||
#, fuzzy
|
||||
#| msgid ""
|
||||
#| "~~~~ {.ignore} // main.rs extern mod world; fn main() { println(~\"hello "
|
||||
#| "~~~~ {.ignore} // main.rs extern crate world; fn main() { println(~\"hello "
|
||||
#| "\" + world::explore()); } ~~~~"
|
||||
msgid ""
|
||||
"~~~~ {.ignore} // `main.rs` extern mod world; fn main() { println!(\"hello "
|
||||
"~~~~ {.ignore} // `main.rs` extern crate world; fn main() { println!(\"hello "
|
||||
"{}\", world::explore()); } ~~~~"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"// main.rs\n"
|
||||
"extern mod world;\n"
|
||||
"extern crate world;\n"
|
||||
"fn main() { println(~\"hello \" + world::explore()); }\n"
|
||||
"~~~~"
|
||||
|
||||
|
@ -4977,7 +4977,7 @@ msgstr "## 標準ライブラリ"
|
|||
#: src/doc/tutorial.md:3187
|
||||
#, fuzzy
|
||||
#| msgid "~~~~ {.ignore} let foo = 10;"
|
||||
msgid "~~~ {.ignore} extern mod std; ~~~"
|
||||
msgid "~~~ {.ignore} extern crate std; ~~~"
|
||||
msgstr ""
|
||||
"~~~~ {.ignore}\n"
|
||||
"let foo = 10;"
|
||||
|
|
|
@ -759,7 +759,7 @@ A view item manages the namespace of a module.
|
|||
View items do not define new items, but rather, simply change other items' visibility.
|
||||
There are several kinds of view item:
|
||||
|
||||
* [`extern mod` declarations](#extern-mod-declarations)
|
||||
* [`extern crate` declarations](#extern-mod-declarations)
|
||||
* [`use` declarations](#use-declarations)
|
||||
|
||||
##### Extern mod declarations
|
||||
|
@ -770,7 +770,7 @@ link_attrs : link_attr [ ',' link_attrs ] + ;
|
|||
link_attr : ident '=' literal ;
|
||||
~~~~
|
||||
|
||||
An _`extern mod` declaration_ specifies a dependency on an external crate.
|
||||
An _`extern crate` declaration_ specifies a dependency on an external crate.
|
||||
The external crate is then bound into the declaring scope
|
||||
as the `ident` provided in the `extern_mod_decl`.
|
||||
|
||||
|
@ -782,16 +782,16 @@ against the `crateid` attributes that were declared on the external crate when
|
|||
it was compiled. If no `crateid` is provided, a default `name` attribute is
|
||||
assumed, equal to the `ident` given in the `extern_mod_decl`.
|
||||
|
||||
Four examples of `extern mod` declarations:
|
||||
Four examples of `extern crate` declarations:
|
||||
|
||||
~~~~ {.ignore}
|
||||
extern mod pcre;
|
||||
extern crate pcre;
|
||||
|
||||
extern mod extra; // equivalent to: extern mod extra = "extra";
|
||||
extern crate extra; // equivalent to: extern crate extra = "extra";
|
||||
|
||||
extern mod rustextra = "extra"; // linking to 'extra' under another name
|
||||
extern crate rustextra = "extra"; // linking to 'extra' under another name
|
||||
|
||||
extern mod foo = "some/where/rust-foo#foo:1.0"; // a full package ID for external tools
|
||||
extern crate foo = "some/where/rust-foo#foo:1.0"; // a full package ID for external tools
|
||||
~~~~
|
||||
|
||||
##### Use declarations
|
||||
|
@ -813,7 +813,7 @@ module item. These declarations may appear at the top of [modules](#modules) and
|
|||
|
||||
*Note*: Unlike in many languages,
|
||||
`use` declarations in Rust do *not* declare linkage dependency with external crates.
|
||||
Rather, [`extern mod` declarations](#extern-mod-declarations) declare linkage dependencies.
|
||||
Rather, [`extern crate` declarations](#extern-mod-declarations) declare linkage dependencies.
|
||||
|
||||
Use declarations support a number of convenient shortcuts:
|
||||
|
||||
|
@ -869,7 +869,7 @@ This also means that top-level module declarations should be at the crate root i
|
|||
of the declared modules within `use` items is desired. It is also possible to use `self` and `super`
|
||||
at the beginning of a `use` item to refer to the current and direct parent modules respectively.
|
||||
All rules regarding accessing declared modules in `use` declarations applies to both module declarations
|
||||
and `extern mod` declarations.
|
||||
and `extern crate` declarations.
|
||||
|
||||
An example of what will and will not work for `use` items:
|
||||
|
||||
|
@ -879,7 +879,7 @@ use foo::extra; // good: foo is at the root of the crate
|
|||
use foo::baz::foobaz; // good: foo is at the root of the crate
|
||||
|
||||
mod foo {
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use foo::extra::time; // good: foo is at crate root
|
||||
// use extra::*; // bad: extra is not at the crate root
|
||||
|
|
|
@ -53,7 +53,7 @@ struct Whizbang;
|
|||
|
||||
To generate the docs, run `rustdoc universe.rs`. By default, it generates a
|
||||
directory called `doc`, with the documentation for `universe` being in
|
||||
`doc/universe/index.html`. If you are using other crates with `extern mod`,
|
||||
`doc/universe/index.html`. If you are using other crates with `extern crate`,
|
||||
rustdoc will even link to them when you use their types, as long as their
|
||||
documentation has already been generated by a previous run of rustdoc, or the
|
||||
crate advertises that its documentation is hosted at a given URL.
|
||||
|
@ -176,7 +176,7 @@ rustdoc --test lib.rs --test-args '--ignored'
|
|||
|
||||
When testing a library, code examples will often show how functions are used,
|
||||
and this code often requires `use`-ing paths from the crate. To accomodate this,
|
||||
rustdoc will implicitly add `extern mod <crate>;` where `<crate>` is the name of
|
||||
rustdoc will implicitly add `extern crate <crate>;` where `<crate>` is the name of
|
||||
the crate being tested to the top of each code example. This means that rustdoc
|
||||
must be able to find a compiled version of the library crate being tested. Extra
|
||||
search paths may be added via the `-L` flag to `rustdoc`.
|
||||
|
|
|
@ -2581,7 +2581,7 @@ As you can see, your module hierarchy is now three modules deep: There is the cr
|
|||
function, and the module `farm`. The module `farm` also contains two functions and a third module `barn`,
|
||||
which contains a function `hay`.
|
||||
|
||||
(In case you already stumbled over `extern mod`: It isn't directly related to a bare `mod`, we'll get to it later. )
|
||||
(In case you already stumbled over `extern crate`: It isn't directly related to a bare `mod`, we'll get to it later. )
|
||||
|
||||
## Paths and visibility
|
||||
|
||||
|
@ -3018,10 +3018,10 @@ as there really is no reason to start from scratch each time you start a new pro
|
|||
|
||||
In Rust terminology, we need a way to refer to other crates.
|
||||
|
||||
For that, Rust offers you the `extern mod` declaration:
|
||||
For that, Rust offers you the `extern crate` declaration:
|
||||
|
||||
~~~
|
||||
extern mod num;
|
||||
extern crate num;
|
||||
// `num` ships with Rust (much like `extra`; more details further down).
|
||||
|
||||
fn main() {
|
||||
|
@ -3030,8 +3030,8 @@ fn main() {
|
|||
}
|
||||
~~~
|
||||
|
||||
Despite its name, `extern mod` is a distinct construct from regular `mod` declarations:
|
||||
A statement of the form `extern mod foo;` will cause `rustc` to search for the crate `foo`,
|
||||
Despite its name, `extern crate` is a distinct construct from regular `mod` declarations:
|
||||
A statement of the form `extern crate foo;` will cause `rustc` to search for the crate `foo`,
|
||||
and if it finds a matching binary it lets you use it from inside your crate.
|
||||
|
||||
The effect it has on your module hierarchy mirrors aspects of both `mod` and `use`:
|
||||
|
@ -3039,19 +3039,19 @@ The effect it has on your module hierarchy mirrors aspects of both `mod` and `us
|
|||
- Like `mod`, it causes `rustc` to actually emit code:
|
||||
The linkage information the binary needs to use the library `foo`.
|
||||
|
||||
- But like `use`, all `extern mod` statements that refer to the same library are interchangeable,
|
||||
- But like `use`, all `extern crate` statements that refer to the same library are interchangeable,
|
||||
as each one really just presents an alias to an external module (the crate root of the library
|
||||
you're linking against).
|
||||
|
||||
Remember how `use`-statements have to go before local declarations because the latter shadows the former?
|
||||
Well, `extern mod` statements also have their own rules in that regard:
|
||||
Both `use` and local declarations can shadow them, so the rule is that `extern mod` has to go in front
|
||||
Well, `extern crate` statements also have their own rules in that regard:
|
||||
Both `use` and local declarations can shadow them, so the rule is that `extern crate` has to go in front
|
||||
of both `use` and local declarations.
|
||||
|
||||
Which can result in something like this:
|
||||
|
||||
~~~
|
||||
extern mod num;
|
||||
extern crate num;
|
||||
|
||||
use farm::dog;
|
||||
use num::rational::Ratio;
|
||||
|
@ -3071,7 +3071,7 @@ they model most closely what people expect to shadow.
|
|||
|
||||
## Package ids
|
||||
|
||||
If you use `extern mod`, per default `rustc` will look for libraries in the library search path (which you can
|
||||
If you use `extern crate`, per default `rustc` will look for libraries in the library search path (which you can
|
||||
extend with the `-L` switch).
|
||||
|
||||
## Crate metadata and settings
|
||||
|
@ -3098,14 +3098,14 @@ Therefore, if you plan to compile your crate as a library, you should annotate i
|
|||
# fn farm() {}
|
||||
~~~~
|
||||
|
||||
You can also specify package ID information in a `extern mod` statement. For
|
||||
example, these `extern mod` statements would both accept and select the
|
||||
You can also specify package ID information in a `extern crate` statement. For
|
||||
example, these `extern crate` statements would both accept and select the
|
||||
crate define above:
|
||||
|
||||
~~~~ {.ignore}
|
||||
extern mod farm;
|
||||
extern mod farm = "farm#2.5";
|
||||
extern mod my_farm = "farm";
|
||||
extern crate farm;
|
||||
extern crate farm = "farm#2.5";
|
||||
extern crate my_farm = "farm";
|
||||
~~~~
|
||||
|
||||
Other crate settings and metadata include things like enabling/disabling certain errors or warnings,
|
||||
|
@ -3133,14 +3133,14 @@ We define two crates, and use one of them as a library in the other.
|
|||
~~~~
|
||||
// `world.rs`
|
||||
#[crate_id = "world#0.42"];
|
||||
# extern mod extra;
|
||||
# extern crate extra;
|
||||
pub fn explore() -> &'static str { "world" }
|
||||
# fn main() {}
|
||||
~~~~
|
||||
|
||||
~~~~ {.ignore}
|
||||
// `main.rs`
|
||||
extern mod world;
|
||||
extern crate world;
|
||||
fn main() { println!("hello {}", world::explore()); }
|
||||
~~~~
|
||||
|
||||
|
@ -3169,7 +3169,7 @@ in the `std` library, which is a crate that ships with Rust.
|
|||
The only magical thing that happens is that `rustc` automatically inserts this line into your crate root:
|
||||
|
||||
~~~ {.ignore}
|
||||
extern mod std;
|
||||
extern crate std;
|
||||
~~~
|
||||
|
||||
As well as this line into every module body:
|
||||
|
@ -3221,7 +3221,7 @@ See the [API documentation][stddoc] for details.
|
|||
|
||||
Rust ships with crates such as the [extra library], an accumulation of useful things,
|
||||
that are however not important enough to deserve a place in the standard
|
||||
library. You can link to a library such as `extra` with an `extern mod extra;`.
|
||||
library. You can link to a library such as `extra` with an `extern crate extra;`.
|
||||
|
||||
[extra library]: extra/index.html
|
||||
|
||||
|
|
|
@ -3,4 +3,4 @@
|
|||
<span class="white-sticker"><a href="http://rust-lang.org">Rust</a> VERSION</span><br>
|
||||
<a href="http://github.com/mozilla/rust/commit/STAMP"
|
||||
class="hash white-sticker">SHORT_HASH</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -9,9 +9,9 @@
|
|||
// except according to those terms.
|
||||
|
||||
#[cfg(rustdoc)]
|
||||
extern mod this = "rustdoc";
|
||||
extern crate this = "rustdoc";
|
||||
|
||||
#[cfg(rustc)]
|
||||
extern mod this = "rustc";
|
||||
extern crate this = "rustc";
|
||||
|
||||
fn main() { this::main() }
|
||||
|
|
|
@ -71,8 +71,8 @@ d.write(
|
|||
"""
|
||||
// AUTO-GENERATED FILE: DO NOT EDIT
|
||||
#[feature(globs, managed_boxes)];
|
||||
extern mod extra;
|
||||
extern mod run_pass_stage2;
|
||||
extern crate extra;
|
||||
extern crate run_pass_stage2;
|
||||
use run_pass_stage2::*;
|
||||
use std::io;
|
||||
use std::io::Writer;
|
||||
|
|
|
@ -129,8 +129,7 @@
|
|||
(defconst rust-mode-keywords
|
||||
'("as"
|
||||
"break"
|
||||
"continue"
|
||||
"crate"
|
||||
"continue" "crate"
|
||||
"do"
|
||||
"else" "enum" "extern"
|
||||
"false" "fn" "for"
|
||||
|
@ -368,7 +367,7 @@ With argument, do it that many times.
|
|||
Negative argument -N means move back to Nth preceding end of defun.
|
||||
|
||||
Assume that this is called after beginning-of-defun. So point is
|
||||
at the beginning of the defun body.
|
||||
at the beginning of the defun body.
|
||||
|
||||
This is written mainly to be used as `end-of-defun-function' for Rust."
|
||||
(interactive "p")
|
||||
|
|
|
@ -28,7 +28,7 @@ CODE_BLOCK_DELIM_REGEX = re.compile(r'~~~')
|
|||
COMMENT_REGEX = re.compile(r'^# ')
|
||||
COMPILER_DIRECTIVE_REGEX = re.compile(r'\#\[(.*)\];')
|
||||
ELLIPSES_REGEX = re.compile(r'\.\.\.')
|
||||
EXTERN_MOD_REGEX = re.compile(r'\bextern mod extra\b')
|
||||
EXTERN_CRATE_REGEX = re.compile(r'\bextern crate extra\b')
|
||||
MAIN_FUNCTION_REGEX = re.compile(r'\bfn main\b')
|
||||
TAGS_REGEX = re.compile(r'\.([\w-]*)')
|
||||
|
||||
|
@ -49,12 +49,12 @@ OUTPUT_BLOCK_HEADER = '\n'.join((
|
|||
|
||||
def add_extern_mod(block):
|
||||
if not has_extern_mod(block):
|
||||
# add `extern mod extra;` after compiler directives
|
||||
# add `extern crate extra;` after compiler directives
|
||||
directives = []
|
||||
while len(block) and is_compiler_directive(block[0]):
|
||||
directives.append(block.popleft())
|
||||
|
||||
block.appendleft("\nextern mod extra;\n\n")
|
||||
block.appendleft("\nextern crate extra;\n\n")
|
||||
block.extendleft(reversed(directives))
|
||||
|
||||
return block
|
||||
|
@ -112,8 +112,8 @@ def extract_code_fragments(dest_dir, lines):
|
|||
|
||||
|
||||
def has_extern_mod(block):
|
||||
"""Checks if a code block has the line `extern mod extra`."""
|
||||
find_extern_mod = lambda x: re.search(EXTERN_MOD_REGEX, x)
|
||||
"""Checks if a code block has the line `extern crate extra`."""
|
||||
find_extern_mod = lambda x: re.search(EXTERN_CRATE_REGEX, x)
|
||||
return any(imap(find_extern_mod, block))
|
||||
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ TEMPLATE = """// Copyright {year} The Rust Project Developers. See the COPYRIGHT
|
|||
// This file was auto-generated using 'src/etc/generate-keyword-span-tests.py'
|
||||
|
||||
#[feature(struct_variant)];
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
{error_deriving}
|
||||
struct Error;
|
||||
|
|
|
@ -22,9 +22,7 @@
|
|||
#[allow(missing_doc)];
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
extern mod collections;
|
||||
|
||||
#[cfg(test)] extern mod extra;
|
||||
extern crate collections;
|
||||
|
||||
use collections::list::{List, Cons, Nil};
|
||||
use collections::list;
|
||||
|
@ -506,8 +504,9 @@ impl<T> Drop for TypedArena<T> {
|
|||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
extern crate extra;
|
||||
use super::{Arena, TypedArena};
|
||||
use extra::test::BenchHarness;
|
||||
use self::extra::test::BenchHarness;
|
||||
|
||||
struct Point {
|
||||
x: int,
|
||||
|
|
|
@ -19,9 +19,8 @@
|
|||
|
||||
#[feature(macro_rules, managed_boxes)];
|
||||
|
||||
#[cfg(test)] extern mod extra;
|
||||
|
||||
extern mod serialize;
|
||||
extern crate serialize;
|
||||
#[cfg(test)] extern crate extra; // benchmark tests need this
|
||||
|
||||
pub use bitv::Bitv;
|
||||
pub use btree::BTree;
|
||||
|
@ -43,4 +42,4 @@ pub mod lru_cache;
|
|||
pub mod priority_queue;
|
||||
pub mod ringbuf;
|
||||
pub mod smallintmap;
|
||||
pub mod treemap;
|
||||
pub mod treemap;
|
||||
|
|
|
@ -59,7 +59,7 @@ the code for these traits: `#[deriving(Decodable, Encodable)]`
|
|||
To encode using Encodable :
|
||||
|
||||
```rust
|
||||
extern mod serialize;
|
||||
extern crate serialize;
|
||||
use extra::json;
|
||||
use std::io;
|
||||
use serialize::Encodable;
|
||||
|
@ -98,7 +98,7 @@ A basic `ToJson` example using a TreeMap of attribute name / attribute value:
|
|||
|
||||
|
||||
```rust
|
||||
extern mod collections;
|
||||
extern crate collections;
|
||||
|
||||
use extra::json;
|
||||
use extra::json::ToJson;
|
||||
|
@ -128,7 +128,7 @@ fn main() {
|
|||
To decode a json string using `Decodable` trait :
|
||||
|
||||
```rust
|
||||
extern mod serialize;
|
||||
extern crate serialize;
|
||||
use serialize::Decodable;
|
||||
|
||||
#[deriving(Decodable)]
|
||||
|
@ -154,7 +154,7 @@ Create a struct called TestStruct1 and serialize and deserialize it to and from
|
|||
using the serialization API, using the derived serialization code.
|
||||
|
||||
```rust
|
||||
extern mod serialize;
|
||||
extern crate serialize;
|
||||
use extra::json;
|
||||
use serialize::{Encodable, Decodable};
|
||||
|
||||
|
@ -186,8 +186,8 @@ This example use the ToJson impl to unserialize the json string.
|
|||
Example of `ToJson` trait implementation for TestStruct1.
|
||||
|
||||
```rust
|
||||
extern mod serialize;
|
||||
extern mod collections;
|
||||
extern crate serialize;
|
||||
extern crate collections;
|
||||
|
||||
use extra::json;
|
||||
use extra::json::ToJson;
|
||||
|
|
|
@ -34,10 +34,10 @@ Rust extras are part of the standard Rust distribution.
|
|||
#[deny(non_camel_case_types)];
|
||||
#[deny(missing_doc)];
|
||||
|
||||
extern mod sync;
|
||||
extern mod serialize;
|
||||
extern crate sync;
|
||||
extern crate serialize;
|
||||
|
||||
extern mod collections;
|
||||
extern crate collections;
|
||||
|
||||
// Utility modules
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
// simplest interface possible for representing and running tests
|
||||
// while providing a base that other test frameworks may build off of.
|
||||
|
||||
extern mod getopts;
|
||||
extern mod term;
|
||||
extern crate getopts;
|
||||
extern crate term;
|
||||
|
||||
use json::ToJson;
|
||||
use json;
|
||||
|
|
|
@ -23,7 +23,7 @@ To load the extension and use it:
|
|||
|
||||
```rust,ignore
|
||||
#[phase(syntax)]
|
||||
extern mod fourcc;
|
||||
extern crate fourcc;
|
||||
|
||||
fn main() {
|
||||
let val = fourcc!("\xC0\xFF\xEE!");
|
||||
|
@ -46,7 +46,7 @@ fn main() {
|
|||
|
||||
#[feature(macro_registrar, managed_boxes)];
|
||||
|
||||
extern mod syntax;
|
||||
extern crate syntax;
|
||||
|
||||
use syntax::ast;
|
||||
use syntax::ast::Name;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
//! file name following `-o`, and accepts both `-h` and `--help` as optional flags.
|
||||
//!
|
||||
//! ~~~{.rust}
|
||||
//! extern mod getopts;
|
||||
//! extern crate getopts;
|
||||
//! use getopts::{optopt,optflag,getopts,OptGroup};
|
||||
//! use std::os;
|
||||
//!
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
//! # Starting with libgreen
|
||||
//!
|
||||
//! ```rust
|
||||
//! extern mod green;
|
||||
//! extern crate green;
|
||||
//!
|
||||
//! #[start]
|
||||
//! fn start(argc: int, argv: **u8) -> int { green::start(argc, argv, main) }
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
//! # Starting with libnative
|
||||
//!
|
||||
//! ```rust
|
||||
//! extern mod native;
|
||||
//! extern crate native;
|
||||
//!
|
||||
//! #[start]
|
||||
//! fn start(argc: int, argv: **u8) -> int { native::start(argc, argv, main) }
|
||||
|
@ -30,7 +30,7 @@
|
|||
//! # Force spawning a native task
|
||||
//!
|
||||
//! ```rust
|
||||
//! extern mod native;
|
||||
//! extern crate native;
|
||||
//!
|
||||
//! fn main() {
|
||||
//! // We're not sure whether this main function is run in 1:1 or M:N mode.
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
#[crate_type = "dylib"];
|
||||
#[license = "MIT/ASL2"];
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
pub mod bigint;
|
||||
pub mod rational;
|
||||
|
|
|
@ -275,7 +275,7 @@ We're going to be building a module that looks more or less like:
|
|||
|
||||
mod __test {
|
||||
#[!resolve_unexported]
|
||||
extern mod extra (name = "extra", vers = "...");
|
||||
extern crate extra (name = "extra", vers = "...");
|
||||
fn main() {
|
||||
#[main];
|
||||
extra::test::test_main_static(::os::args(), tests)
|
||||
|
|
|
@ -31,14 +31,14 @@ This API is completely unstable and subject to change.
|
|||
#[allow(unknown_features)]; // Note: remove it after a snapshot.
|
||||
#[feature(quote)];
|
||||
|
||||
extern mod extra;
|
||||
extern mod flate;
|
||||
extern mod arena;
|
||||
extern mod syntax;
|
||||
extern mod serialize;
|
||||
extern mod sync;
|
||||
extern mod getopts;
|
||||
extern mod collections;
|
||||
extern crate extra;
|
||||
extern crate flate;
|
||||
extern crate arena;
|
||||
extern crate syntax;
|
||||
extern crate serialize;
|
||||
extern crate sync;
|
||||
extern crate getopts;
|
||||
extern crate collections;
|
||||
|
||||
use back::link;
|
||||
use driver::session;
|
||||
|
|
|
@ -169,7 +169,7 @@ fn extract_crate_info(i: &ast::ViewItem) -> Option<CrateInfo> {
|
|||
match i.node {
|
||||
ast::ViewItemExternMod(ident, ref path_opt, id) => {
|
||||
let ident = token::get_ident(ident);
|
||||
debug!("resolving extern mod stmt. ident: {:?} path_opt: {:?}",
|
||||
debug!("resolving extern crate stmt. ident: {:?} path_opt: {:?}",
|
||||
ident, path_opt);
|
||||
let (name, version) = match *path_opt {
|
||||
Some((ref path_str, _)) => {
|
||||
|
|
|
@ -69,7 +69,7 @@ pub struct CStore {
|
|||
intr: @IdentInterner
|
||||
}
|
||||
|
||||
// Map from NodeId's of local extern mod statements to crate numbers
|
||||
// Map from NodeId's of local extern crate statements to crate numbers
|
||||
type extern_mod_crate_map = HashMap<ast::NodeId, ast::CrateNum>;
|
||||
|
||||
impl CStore {
|
||||
|
|
|
@ -418,7 +418,7 @@ struct Module {
|
|||
imports: RefCell<~[@ImportDirective]>,
|
||||
|
||||
// The external module children of this node that were declared with
|
||||
// `extern mod`.
|
||||
// `extern crate`.
|
||||
external_module_children: RefCell<HashMap<Name, @Module>>,
|
||||
|
||||
// The anonymous children of this node. Anonymous children are pseudo-
|
||||
|
@ -2679,7 +2679,7 @@ impl Resolver {
|
|||
};
|
||||
self.resolve_error(span,
|
||||
format!("unresolved import. maybe \
|
||||
a missing `extern mod \
|
||||
a missing `extern crate \
|
||||
{}`?",
|
||||
segment_name));
|
||||
return Failed;
|
||||
|
|
|
@ -1021,7 +1021,7 @@ fn item_module(w: &mut Writer, cx: &Context,
|
|||
clean::ViewItemItem(ref item) => {
|
||||
match item.inner {
|
||||
clean::ExternMod(ref name, ref src, _) => {
|
||||
if_ok!(write!(w, "<tr><td><code>extern mod {}",
|
||||
if_ok!(write!(w, "<tr><td><code>extern crate {}",
|
||||
name.as_slice()));
|
||||
match *src {
|
||||
Some(ref src) => if_ok!(write!(w, " = \"{}\"",
|
||||
|
|
|
@ -15,13 +15,13 @@
|
|||
|
||||
#[feature(globs, struct_variant, managed_boxes)];
|
||||
|
||||
extern mod syntax;
|
||||
extern mod rustc;
|
||||
extern mod extra;
|
||||
extern mod serialize;
|
||||
extern mod sync;
|
||||
extern mod getopts;
|
||||
extern mod collections;
|
||||
extern crate syntax;
|
||||
extern crate rustc;
|
||||
extern crate extra;
|
||||
extern crate serialize;
|
||||
extern crate sync;
|
||||
extern crate getopts;
|
||||
extern crate collections;
|
||||
|
||||
use std::local_data;
|
||||
use std::io;
|
||||
|
|
|
@ -144,10 +144,10 @@ fn maketest(s: &str, cratename: &str) -> ~str {
|
|||
#[allow(unused_variable, dead_assignment, unused_mut, attribute_usage, dead_code)];
|
||||
";
|
||||
if s.contains("extra") {
|
||||
prog.push_str("extern mod extra;\n");
|
||||
prog.push_str("extern crate extra;\n");
|
||||
}
|
||||
if s.contains(cratename) {
|
||||
prog.push_str(format!("extern mod {};\n", cratename));
|
||||
prog.push_str(format!("extern crate {};\n", cratename));
|
||||
}
|
||||
if s.contains("fn main") {
|
||||
prog.push_str(s);
|
||||
|
|
|
@ -42,7 +42,7 @@ via `close` and `delete` methods.
|
|||
#[feature(macro_rules)];
|
||||
#[deny(unused_result, unused_must_use)];
|
||||
|
||||
#[cfg(test)] extern mod green;
|
||||
#[cfg(test)] extern crate green;
|
||||
|
||||
use std::cast;
|
||||
use std::io;
|
||||
|
|
|
@ -63,7 +63,7 @@ impl<'a> ToBase64 for &'a [u8] {
|
|||
* # Example
|
||||
*
|
||||
* ```rust
|
||||
* extern mod serialize;
|
||||
* extern crate serialize;
|
||||
* use serialize::base64::{ToBase64, STANDARD};
|
||||
*
|
||||
* fn main () {
|
||||
|
@ -189,7 +189,7 @@ impl<'a> FromBase64 for &'a str {
|
|||
* This converts a string literal to base64 and back.
|
||||
*
|
||||
* ```rust
|
||||
* extern mod serialize;
|
||||
* extern crate serialize;
|
||||
* use serialize::base64::{ToBase64, FromBase64, STANDARD};
|
||||
* use std::str;
|
||||
*
|
||||
|
|
|
@ -28,7 +28,7 @@ impl<'a> ToHex for &'a [u8] {
|
|||
* # Example
|
||||
*
|
||||
* ```rust
|
||||
* extern mod serialize;
|
||||
* extern crate serialize;
|
||||
* use serialize::hex::ToHex;
|
||||
*
|
||||
* fn main () {
|
||||
|
@ -89,7 +89,7 @@ impl<'a> FromHex for &'a str {
|
|||
* This converts a string literal to hexadecimal and back.
|
||||
*
|
||||
* ```rust
|
||||
* extern mod serialize;
|
||||
* extern crate serialize;
|
||||
* use serialize::hex::{FromHex, ToHex};
|
||||
* use std::str;
|
||||
*
|
||||
|
|
|
@ -24,7 +24,7 @@ Core encoding and decoding interfaces.
|
|||
|
||||
// test harness access
|
||||
#[cfg(test)]
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
pub use self::serialize::{Decoder, Encoder, Decodable, Encodable,
|
||||
DecoderHelpers, EncoderHelpers};
|
||||
|
|
|
@ -56,7 +56,7 @@ use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
|
|||
use clone::Clone;
|
||||
use cmp::{Eq, Equiv, max};
|
||||
use default::Default;
|
||||
#[cfg(not(stage0))] use fmt;
|
||||
use fmt;
|
||||
use hash::Hash;
|
||||
use iter;
|
||||
use iter::{Iterator, FromIterator, Extendable};
|
||||
|
@ -66,7 +66,7 @@ use num;
|
|||
use option::{None, Option, Some};
|
||||
use rand::Rng;
|
||||
use rand;
|
||||
#[cfg(not(stage0))] use result::{Ok, Err};
|
||||
use result::{Ok, Err};
|
||||
use vec::{ImmutableVector, MutableVector, OwnedVector, Items, MutItems};
|
||||
use vec_ng;
|
||||
use vec_ng::Vec;
|
||||
|
@ -597,7 +597,6 @@ impl<K:Hash + Eq + Clone,V:Clone> Clone for HashMap<K,V> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
impl<A: fmt::Show + Hash + Eq, B: fmt::Show> fmt::Show for HashMap<A, B> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if_ok!(write!(f.buf, r"\{"))
|
||||
|
@ -876,7 +875,6 @@ impl<T:Hash + Eq + Clone> Clone for HashSet<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
impl<A: fmt::Show + Hash + Eq> fmt::Show for HashSet<A> {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if_ok!(write!(f.buf, r"\{"))
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
//! `std` is imported at the topmost level of every crate by default, as
|
||||
//! if the first line of each crate was
|
||||
//!
|
||||
//! extern mod std;
|
||||
//! extern crate std;
|
||||
//!
|
||||
//! This means that the contents of std can be accessed from any context
|
||||
//! with the `std::` path prefix, as in `use std::vec`, `use std::task::spawn`,
|
||||
|
@ -64,15 +64,15 @@
|
|||
// When testing libstd, bring in libuv as the I/O backend so tests can print
|
||||
// things and all of the std::io tests have an I/O interface to run on top
|
||||
// of
|
||||
#[cfg(test)] extern mod rustuv = "rustuv";
|
||||
#[cfg(test)] extern mod native = "native";
|
||||
#[cfg(test)] extern mod green = "green";
|
||||
#[cfg(test)] extern crate rustuv = "rustuv";
|
||||
#[cfg(test)] extern crate native = "native";
|
||||
#[cfg(test)] extern crate green = "green";
|
||||
|
||||
// Make extra accessible for benchmarking
|
||||
#[cfg(test)] extern mod extra = "extra";
|
||||
#[cfg(test)] extern crate extra = "extra";
|
||||
|
||||
// Make std testable by not duplicating lang items. See #2912
|
||||
#[cfg(test)] extern mod realstd = "std";
|
||||
#[cfg(test)] extern crate realstd = "std";
|
||||
#[cfg(test)] pub use kinds = realstd::kinds;
|
||||
#[cfg(test)] pub use ops = realstd::ops;
|
||||
#[cfg(test)] pub use cmp = realstd::cmp;
|
||||
|
|
|
@ -10,8 +10,6 @@
|
|||
|
||||
//! Runtime environment settings
|
||||
|
||||
// NOTE: remove `POISON_ON_FREE` after a snapshot
|
||||
|
||||
use from_str::from_str;
|
||||
use option::{Some, None};
|
||||
use os;
|
||||
|
@ -23,7 +21,6 @@ static mut MIN_STACK: uint = 2 * 1024 * 1024;
|
|||
/// This default corresponds to 20M of cache per scheduler (at the default size).
|
||||
static mut MAX_CACHED_STACKS: uint = 10;
|
||||
static mut DEBUG_BORROW: bool = false;
|
||||
static mut POISON_ON_FREE: bool = false;
|
||||
|
||||
pub fn init() {
|
||||
unsafe {
|
||||
|
@ -43,10 +40,6 @@ pub fn init() {
|
|||
Some(_) => DEBUG_BORROW = true,
|
||||
None => ()
|
||||
}
|
||||
match os::getenv("RUST_POISON_ON_FREE") {
|
||||
Some(_) => POISON_ON_FREE = true,
|
||||
None => ()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,7 +54,3 @@ pub fn max_cached_stacks() -> uint {
|
|||
pub fn debug_borrow() -> bool {
|
||||
unsafe { DEBUG_BORROW }
|
||||
}
|
||||
|
||||
pub fn poison_on_free() -> bool {
|
||||
unsafe { POISON_ON_FREE }
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@ use ops::Drop;
|
|||
use option::{Option, None, Some};
|
||||
use ptr;
|
||||
use ptr::RawPtr;
|
||||
use rt::env;
|
||||
use rt::global_heap;
|
||||
use rt::local::Local;
|
||||
use rt::task::Task;
|
||||
|
@ -41,7 +40,6 @@ pub struct MemoryRegion {
|
|||
pub struct LocalHeap {
|
||||
priv memory_region: MemoryRegion,
|
||||
|
||||
priv poison_on_free: bool,
|
||||
priv live_allocs: *mut raw::Box<()>,
|
||||
}
|
||||
|
||||
|
@ -54,7 +52,6 @@ impl LocalHeap {
|
|||
};
|
||||
LocalHeap {
|
||||
memory_region: region,
|
||||
poison_on_free: env::poison_on_free(),
|
||||
live_allocs: ptr::mut_null(),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,14 +109,14 @@ use container::{Container, Mutable};
|
|||
use cmp::{Eq, TotalOrd, Ordering, Less, Equal, Greater};
|
||||
use cmp;
|
||||
use default::Default;
|
||||
#[cfg(not(stage0))] use fmt;
|
||||
use fmt;
|
||||
use iter::*;
|
||||
use num::{Integer, CheckedAdd, Saturating, checked_next_power_of_two};
|
||||
use option::{None, Option, Some};
|
||||
use ptr;
|
||||
use ptr::RawPtr;
|
||||
use rt::global_heap::{malloc_raw, realloc_raw, exchange_free};
|
||||
#[cfg(not(stage0))] use result::{Ok, Err};
|
||||
use result::{Ok, Err};
|
||||
use mem;
|
||||
use mem::size_of;
|
||||
use kinds::marker;
|
||||
|
@ -2643,7 +2643,6 @@ impl<A: DeepClone> DeepClone for ~[A] {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
impl<'a, T: fmt::Show> fmt::Show for &'a [T] {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
if_ok!(write!(f.buf, "["));
|
||||
|
@ -2660,7 +2659,6 @@ impl<'a, T: fmt::Show> fmt::Show for &'a [T] {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
impl<T: fmt::Show> fmt::Show for ~[T] {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
self.as_slice().fmt(f)
|
||||
|
|
|
@ -495,7 +495,7 @@ impl Drop for Mutex {
|
|||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
extern mod native;
|
||||
extern crate native;
|
||||
use super::{Mutex, StaticMutex, MUTEX_INIT};
|
||||
|
||||
#[test]
|
||||
|
|
|
@ -1058,7 +1058,7 @@ pub enum ViewItem_ {
|
|||
// ident: name used to refer to this crate in the code
|
||||
// optional (InternedString,StrStyle): if present, this is a location
|
||||
// (containing arbitrary characters) from which to fetch the crate sources
|
||||
// For example, extern mod whatever = "github.com/mozilla/rust"
|
||||
// For example, extern crate whatever = "github.com/mozilla/rust"
|
||||
ViewItemExternMod(Ident, Option<(InternedString,StrStyle)>, NodeId),
|
||||
ViewItemUse(~[@ViewPath]),
|
||||
}
|
||||
|
|
|
@ -32,10 +32,10 @@ This API is completely unstable and subject to change.
|
|||
|
||||
#[deny(non_camel_case_types)];
|
||||
|
||||
#[cfg(test)] extern mod extra;
|
||||
extern mod serialize;
|
||||
extern mod term;
|
||||
extern mod collections;
|
||||
#[cfg(test)] extern crate extra;
|
||||
extern crate serialize;
|
||||
extern crate term;
|
||||
extern crate collections;
|
||||
|
||||
pub mod util {
|
||||
pub mod interner;
|
||||
|
|
|
@ -4528,7 +4528,7 @@ impl Parser {
|
|||
// parse one of the items or view items allowed by the
|
||||
// flags; on failure, return IoviNone.
|
||||
// NB: this function no longer parses the items inside an
|
||||
// extern mod.
|
||||
// extern crate.
|
||||
fn parse_item_or_view_item(&mut self,
|
||||
attrs: ~[Attribute],
|
||||
macros_allowed: bool)
|
||||
|
@ -4566,13 +4566,12 @@ impl Parser {
|
|||
let next_is_mod = self.eat_keyword(keywords::Mod);
|
||||
|
||||
if next_is_mod || self.eat_keyword(keywords::Crate) {
|
||||
// NOTE(flaper87): Uncomment this when this changes gets into stage0
|
||||
//
|
||||
// if next_is_mod {
|
||||
// self.span_err(self.span,
|
||||
// format!("`extern mod` is obsolete, use `extern crate` instead \
|
||||
// to refer to external crates."))
|
||||
// }
|
||||
if next_is_mod {
|
||||
self.span_err(mk_sp(lo, self.last_span.hi),
|
||||
format!("`extern mod` is obsolete, use \
|
||||
`extern crate` instead \
|
||||
to refer to external crates."))
|
||||
}
|
||||
return self.parse_item_extern_crate(lo, visibility, attrs);
|
||||
}
|
||||
|
||||
|
@ -4971,7 +4970,7 @@ impl Parser {
|
|||
let mut items = ~[];
|
||||
|
||||
// I think this code would probably read better as a single
|
||||
// loop with a mutable three-state-variable (for extern mods,
|
||||
// loop with a mutable three-state-variable (for extern crates,
|
||||
// view items, and regular items) ... except that because
|
||||
// of macros, I'd like to delay that entire check until later.
|
||||
loop {
|
||||
|
@ -4987,12 +4986,12 @@ impl Parser {
|
|||
IoviViewItem(view_item) => {
|
||||
match view_item.node {
|
||||
ViewItemUse(..) => {
|
||||
// `extern mod` must precede `use`.
|
||||
// `extern crate` must precede `use`.
|
||||
extern_mod_allowed = false;
|
||||
}
|
||||
ViewItemExternMod(..) if !extern_mod_allowed => {
|
||||
self.span_err(view_item.span,
|
||||
"\"extern mod\" declarations are not allowed here");
|
||||
"\"extern crate\" declarations are not allowed here");
|
||||
}
|
||||
ViewItemExternMod(..) => {}
|
||||
}
|
||||
|
@ -5020,7 +5019,7 @@ impl Parser {
|
|||
IoviViewItem(view_item) => {
|
||||
attrs = self.parse_outer_attributes();
|
||||
self.span_err(view_item.span,
|
||||
"`use` and `extern mod` declarations must precede items");
|
||||
"`use` and `extern crate` declarations must precede items");
|
||||
}
|
||||
IoviItem(item) => {
|
||||
attrs = self.parse_outer_attributes();
|
||||
|
@ -5060,7 +5059,7 @@ impl Parser {
|
|||
IoviViewItem(view_item) => {
|
||||
// I think this can't occur:
|
||||
self.span_err(view_item.span,
|
||||
"`use` and `extern mod` declarations must precede items");
|
||||
"`use` and `extern crate` declarations must precede items");
|
||||
}
|
||||
IoviItem(item) => {
|
||||
// FIXME #5668: this will occur for a macro invocation:
|
||||
|
|
|
@ -2061,7 +2061,7 @@ pub fn print_view_item(s: &mut State, item: &ast::ViewItem) -> io::IoResult<()>
|
|||
if_ok!(print_visibility(s, item.vis));
|
||||
match item.node {
|
||||
ast::ViewItemExternMod(id, ref optional_path, _) => {
|
||||
if_ok!(head(s, "extern mod"));
|
||||
if_ok!(head(s, "extern crate"));
|
||||
if_ok!(print_ident(s, id));
|
||||
for &(ref p, style) in optional_path.iter() {
|
||||
if_ok!(space(&mut s.s));
|
||||
|
|
|
@ -61,8 +61,8 @@ Examples of string representations:
|
|||
|
||||
// test harness access
|
||||
#[cfg(test)]
|
||||
extern mod extra;
|
||||
extern mod serialize;
|
||||
extern crate extra;
|
||||
extern crate serialize;
|
||||
|
||||
use std::str;
|
||||
use std::vec;
|
||||
|
|
|
@ -1,3 +1,11 @@
|
|||
S 2014-02-14 18477ac
|
||||
freebsd-x86_64 102df7dfab2a1c59d9e2f16a3f02f368310dd022
|
||||
linux-i386 fcf5891e9b3c7c9ef5ee5ea37e62089346099425
|
||||
linux-x86_64 d7c2df185fd2e25b4b8f5b2caad277b5ba664b81
|
||||
macos-i386 c15faa408339ceebbb68e952e9bf7f2624ceb9e0
|
||||
macos-x86_64 445c6759db5e69250b8a8631ea7751d1474e4250
|
||||
winnt-i386 f78a892f47627f34233e44c2ff4a00b68063a2ce
|
||||
|
||||
S 2014-02-12 c62f6ce
|
||||
freebsd-x86_64 737a423c5f803119ff5a692eac432fa9d0c595a8
|
||||
linux-i386 a7e90e27e8b6a3fa79ddc15f0ed217ccbade875d
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
#[crate_id="crateresolve4b#0.1"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
extern mod crateresolve4a = "crateresolve4a#0.2";
|
||||
extern crate crateresolve4a = "crateresolve4a#0.2";
|
||||
|
||||
pub fn f() -> int { crateresolve4a::g() }
|
||||
|
|
|
@ -13,6 +13,6 @@
|
|||
#[crate_id="crateresolve4b#0.2"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
extern mod crateresolve4a = "crateresolve4a#0.1";
|
||||
extern crate crateresolve4a = "crateresolve4a#0.1";
|
||||
|
||||
pub fn g() -> int { crateresolve4a::f() }
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
// These both have the same version but differ in other metadata
|
||||
pub mod a {
|
||||
extern mod cr_1 (name = "crateresolve_calories", vers = "0.1", calories="100");
|
||||
extern crate cr_1 (name = "crateresolve_calories", vers = "0.1", calories="100");
|
||||
pub fn f() -> int { cr_1::f() }
|
||||
}
|
||||
|
||||
pub mod b {
|
||||
extern mod cr_2 (name = "crateresolve_calories", vers = "0.1", calories="200");
|
||||
extern crate cr_2 (name = "crateresolve_calories", vers = "0.1", calories="200");
|
||||
pub fn f() -> int { cr_2::f() }
|
||||
}
|
||||
|
|
|
@ -9,11 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
#[crate_id="crateresolve_calories#0.1"];
|
||||
// NOTE: remove after the next snapshot
|
||||
#[link(name = "crateresolve_calories",
|
||||
vers = "0.1",
|
||||
calories = "100")];
|
||||
|
||||
#[crate_type = "lib"];
|
||||
|
||||
pub fn f() -> int { 100 }
|
||||
|
|
|
@ -9,11 +9,6 @@
|
|||
// except according to those terms.
|
||||
|
||||
#[crate_id="crateresolve_calories#0.1"];
|
||||
// NOTE: remove after the next snapshot
|
||||
#[link(name = "crateresolve_calories",
|
||||
vers = "0.1",
|
||||
calories = "200")];
|
||||
|
||||
#[crate_type = "lib"];
|
||||
|
||||
pub fn f() -> int { 200 }
|
||||
|
|
|
@ -13,4 +13,4 @@
|
|||
#[crate_id="b#0.1"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
extern mod a;
|
||||
extern crate a;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#[crate_id="issue_2526#0.2"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
struct arc_destruct<T> {
|
||||
_data: int,
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#[crate_id="req"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::cell::RefCell;
|
||||
use std::hashmap::HashMap;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-fast windows doesn't like extern mod
|
||||
// ignore-fast windows doesn't like extern crate
|
||||
// aux-build:issue-9906.rs
|
||||
|
||||
pub use other::FooBar;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
#[crate_type = "lib"];
|
||||
|
||||
extern mod issue2378a;
|
||||
extern crate issue2378a;
|
||||
|
||||
use issue2378a::maybe;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#[crate_id="c#0.1"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
extern mod a;
|
||||
extern crate a;
|
||||
|
||||
use a::to_strz;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#[allow(unused_imports)];
|
||||
#[feature(globs)];
|
||||
|
||||
extern mod issue_2316_a;
|
||||
extern crate issue_2316_a;
|
||||
|
||||
pub mod cloth {
|
||||
use issue_2316_a::*;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#[feature(macro_registrar)];
|
||||
|
||||
extern mod syntax;
|
||||
extern crate syntax;
|
||||
|
||||
use std::any::Any;
|
||||
use std::local_data;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#[feature(globs, macro_registrar, macro_rules, quote)];
|
||||
|
||||
extern mod syntax;
|
||||
extern crate syntax;
|
||||
|
||||
use syntax::ast::{Name, TokenTree};
|
||||
use syntax::codemap::Span;
|
||||
|
|
|
@ -8,6 +8,6 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod pub_use_xcrate1;
|
||||
extern crate pub_use_xcrate1;
|
||||
|
||||
pub use pub_use_xcrate1::Foo;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// aux-build:trait_default_method_xc_aux.rs
|
||||
|
||||
extern mod aux = "trait_default_method_xc_aux";
|
||||
extern crate aux = "trait_default_method_xc_aux";
|
||||
use aux::A;
|
||||
|
||||
pub struct a_struct { x: int }
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod extra;
|
||||
extern mod collections;
|
||||
extern crate extra;
|
||||
extern crate collections;
|
||||
|
||||
use extra::time;
|
||||
use collections::TreeMap;
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod extra;
|
||||
extern mod collections;
|
||||
extern crate extra;
|
||||
extern crate collections;
|
||||
|
||||
use collections::bitv::BitvSet;
|
||||
use collections::TreeSet;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#[feature(macro_rules)];
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use extra::time::precise_time_s;
|
||||
use std::mem::swap;
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
// different scalability characteristics compared to the select
|
||||
// version.
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::comm;
|
||||
use std::os;
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
//
|
||||
// I *think* it's the same, more or less.
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::os;
|
||||
use std::task;
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
// This also serves as a pipes test, because Arcs are implemented with pipes.
|
||||
|
||||
extern mod extra;
|
||||
extern mod sync;
|
||||
extern crate extra;
|
||||
extern crate sync;
|
||||
|
||||
use sync::Arc;
|
||||
use sync::MutexArc;
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
|
||||
// This also serves as a pipes test, because Arcs are implemented with pipes.
|
||||
|
||||
extern mod extra;
|
||||
extern mod sync;
|
||||
extern crate extra;
|
||||
extern crate sync;
|
||||
|
||||
use sync::RWArc;
|
||||
use sync::Future;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::os;
|
||||
use std::uint;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::os;
|
||||
use std::uint;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::task::spawn;
|
||||
use std::os;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::os;
|
||||
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod sync;
|
||||
extern mod arena;
|
||||
extern crate sync;
|
||||
extern crate arena;
|
||||
|
||||
use std::iter::range_step;
|
||||
use sync::Future;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// chameneos
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::option;
|
||||
use std::os;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::os;
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// ignore-pretty the `let to_child` line gets an extra newline
|
||||
// multi tasking k-nucleotide
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::cmp::Ord;
|
||||
use std::comm;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// ignore-test
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::cast::transmute;
|
||||
use std::i32::range;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
|
||||
*/
|
||||
|
||||
extern mod extra;
|
||||
extern mod getopts;
|
||||
extern crate extra;
|
||||
extern crate getopts;
|
||||
|
||||
use extra::time;
|
||||
use std::os;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod num;
|
||||
extern crate num;
|
||||
|
||||
use std::from_str::FromStr;
|
||||
use std::num::One;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// ignore-test arcs no longer unwrap
|
||||
|
||||
extern mod sync;
|
||||
extern crate sync;
|
||||
|
||||
use std::from_str::FromStr;
|
||||
use std::iter::count;
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
// Microbenchmark for the smallintmap library
|
||||
|
||||
extern mod extra;
|
||||
extern mod collections;
|
||||
extern crate extra;
|
||||
extern crate collections;
|
||||
|
||||
use collections::SmallIntMap;
|
||||
use std::os;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
extern mod extra;
|
||||
extern crate extra;
|
||||
|
||||
use std::io;
|
||||
use std::io::stdio::StdReader;
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
|
||||
#[feature(managed_boxes)];
|
||||
|
||||
extern mod extra;
|
||||
extern mod collections;
|
||||
extern crate extra;
|
||||
extern crate collections;
|
||||
|
||||
use collections::list::{List, Cons, Nil};
|
||||
use extra::time::precise_time_s;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
// ignore-fast aux-build
|
||||
// aux-build:ambig_impl_2_lib.rs
|
||||
extern mod ambig_impl_2_lib;
|
||||
extern crate ambig_impl_2_lib;
|
||||
use ambig_impl_2_lib::me;
|
||||
trait me {
|
||||
fn me(&self) -> uint;
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod sync;
|
||||
extern crate sync;
|
||||
use sync::RWArc;
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
// error-pattern: lifetime of return value does not outlive the function call
|
||||
extern mod sync;
|
||||
extern crate sync;
|
||||
use sync::RWArc;
|
||||
fn main() {
|
||||
let x = ~RWArc::new(1);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod sync;
|
||||
extern crate sync;
|
||||
use sync::RWArc;
|
||||
fn main() {
|
||||
let x = ~RWArc::new(1);
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern mod sync;
|
||||
extern crate sync;
|
||||
use sync::RWArc;
|
||||
fn main() {
|
||||
let x = ~RWArc::new(1);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue