Skip to content

Commit d9f82bd

Browse files
committed
---
yaml --- r: 15344 b: refs/heads/try c: ce8023b h: refs/heads/master v: v3
1 parent 577314b commit d9f82bd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1005
-231
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: d621ada003cd3464d52fb65f95f6767e62befa6f
5+
refs/heads/try: ce8023b9aca841e965228cf9dc4ba5cb27c9457c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/doc/rust.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,9 +1617,9 @@ is bounds-checked at run-time. When the check fails, it will put the
16171617
task in a _failing state_.
16181618

16191619
~~~~
1620-
# let builder = task::task_builder();
1621-
# task::unsupervise(builder);
1622-
# task::run(builder) {||
1620+
# let buildr = task::builder();
1621+
# task::unsupervise(buildr);
1622+
# task::run(buildr) {||
16231623
16241624
[1, 2, 3, 4][0];
16251625
[mut 'x', 'y'][1] = 'z';

branches/try/doc/tutorial.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,6 +1686,7 @@ purpose, you create a `.rc` crate file, which references any number of
16861686

16871687
~~~~ {.ignore}
16881688
#[link(name = "farm", vers = "2.5", author = "mjh")];
1689+
#[crate_type = "lib"];
16891690
mod cow;
16901691
mod chicken;
16911692
mod horse;
@@ -1694,7 +1695,9 @@ mod horse;
16941695
Compiling this file will cause `rustc` to look for files named
16951696
`cow.rs`, `chicken.rs`, `horse.rs` in the same directory as the `.rc`
16961697
file, compile them all together, and, depending on the presence of the
1697-
`--lib` switch, output a shared library or an executable.
1698+
`crate_type = "lib"` attribute, output a shared library or an executable.
1699+
(If the line `#[crate_type = "lib"];` was omitted, `rustc` would create an
1700+
executable.)
16981701

16991702
The `#[link(...)]` part provides meta information about the module,
17001703
which other crates can use to load the right module. More about that
@@ -1717,9 +1720,9 @@ content to the `poultry` module itself.
17171720

17181721
## Using other crates
17191722

1720-
Having compiled a crate with `--lib`, you can use it in another crate
1721-
with a `use` directive. We've already seen `use std` in several of the
1722-
examples, which loads in the [standard library][std].
1723+
Having compiled a crate that contains the `#[crate_type = "lib"]` attribute,
1724+
you can use it in another crate with a `use` directive. We've already seen
1725+
`use std` in several of the examples, which loads in the [standard library][std].
17231726

17241727
[std]: http://doc.rust-lang.org/doc/std/index/General.html
17251728

branches/try/src/cargo/cargo.rc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,12 @@
1717

1818
#[crate_type = "bin"];
1919

20+
#[no_core];
21+
22+
use core(vers = "0.2");
23+
use std(vers = "0.2");
24+
use rustc(vers = "0.2");
25+
26+
import core::*;
27+
2028
mod pgp;

branches/try/src/cargo/cargo.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// cargo.rs - Rust package manager
22

3-
use rustc;
4-
use std;
5-
63
import rustc::syntax::{ast, codemap};
74
import rustc::syntax::parse::parser;
85
import rustc::util::filesearch::{get_cargo_root, get_cargo_root_nearest,

branches/try/src/cargo/pgp.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use std;
2-
31
fn gpg(args: [str]) -> { status: int, out: str, err: str } {
42
ret run::program_output("gpg", args);
53
}

branches/try/src/compiletest/compiletest.rc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#[crate_type = "bin"];
22

3-
use std;
3+
#[no_core];
4+
5+
use core(vers = "0.2");
6+
use std(vers = "0.2");
7+
8+
import core::*;
49

510
mod procsrv;
611
mod util;

branches/try/src/compiletest/runtest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ fn check_expected_errors(expected_errors: [errors::expected_error],
246246
// is the ending point, and * represents ANSI color codes.
247247
for line: str in str::split_char(procres.stderr, '\n') {
248248
let mut was_expected = false;
249-
vec::iteri(expected_errors) {|i, ee|
249+
for vec::eachi(expected_errors) {|i, ee|
250250
if !found_flags[i] {
251251
#debug["prefix=%s ee.kind=%s ee.msg=%s line=%s",
252252
prefixes[i], ee.kind, ee.msg, line];
@@ -255,6 +255,7 @@ fn check_expected_errors(expected_errors: [errors::expected_error],
255255
str::contains(line, ee.msg)) {
256256
found_flags[i] = true;
257257
was_expected = true;
258+
break;
258259
}
259260
}
260261
}

branches/try/src/etc/indenter

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/perl -w
2+
3+
$ident = 0;
4+
while (<>) {
5+
if (/^rust: ">>/) {
6+
$indent += 1;
7+
} elsif (/^rust: "<</) {
8+
$indent -= 1;
9+
}
10+
11+
printf "%03d ", $indent;
12+
for ($i = 0; $i < $indent; $i++) {
13+
printf(" ");
14+
}
15+
print;
16+
}
17+

branches/try/src/fuzzer/fuzzer.rc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22

33
#[crate_type = "bin"];
44

5-
use std;
6-
use rustc;
5+
#[no_core];
6+
7+
use core(vers = "0.2");
8+
use std(vers = "0.2");
9+
use rustc(vers = "0.2");
10+
11+
import core::*;
712

813
// Local Variables:
914
// fill-column: 78;

branches/try/src/libcore/core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ mod core {
4040
// Similar to above. Some magic to make core testable.
4141
#[cfg(test)]
4242
mod std {
43-
use std;
43+
use std(vers = "0.2");
4444
import std::test;
4545
}
4646

branches/try/src/libcore/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ mod tests {
849849
};
850850
assert (ostream as uint != 0u);
851851
let s = "hello";
852-
let mut buf = str::bytes(s) + [0 as u8];
852+
let mut buf = vec::to_mut(str::bytes(s) + [0 as u8]);
853853
vec::as_mut_buf(buf) {|b|
854854
assert (libc::fwrite(b as *c_void, 1u, str::len(s) + 1u, ostream) ==
855855
buf.len())};

branches/try/src/libcore/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,7 @@ mod unsafe {
16581658
Does not verify that the vector contains valid UTF-8.
16591659
"]
16601660
unsafe fn from_bytes(v: [const u8]) -> str unsafe {
1661-
let mut vcopy: [u8] = v + [0u8];
1661+
let vcopy = v + [0u8];
16621662
let scopy: str = ::unsafe::reinterpret_cast(vcopy);
16631663
::unsafe::forget(vcopy);
16641664
ret scopy;

0 commit comments

Comments
 (0)