Skip to content

Commit b7ad91d

Browse files
committed
---
yaml --- r: 97788 b: refs/heads/snap-stage3 c: 363fa51 h: refs/heads/master v: v3
1 parent f458ccf commit b7ad91d

Some content is hidden

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

61 files changed

+309
-483
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: c58d2bacb78ed0d2b9c0c0909e56f390b525aabd
4+
refs/heads/snap-stage3: 363fa51c66a5cffc5e29a59dcfafc4222b07189c
55
refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/complement-cheatsheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ let reader : File = File::open(&path).unwrap_or_else(on_error);
6262
Use the [`lines`](http://static.rust-lang.org/doc/master/std/io/trait.Buffer.html#method.lines) method on a [`BufferedReader`](http://static.rust-lang.org/doc/master/std/io/buffered/struct.BufferedReader.html).
6363

6464
~~~
65-
use std::io::BufferedReader;
66-
# use std::io::MemReader;
65+
use std::io::buffered::BufferedReader;
66+
# use std::io::mem::MemReader;
6767
6868
# let reader = MemReader::new(~[]);
6969

branches/snap-stage3/doc/guide-conditions.md

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ An example program that does this task reads like this:
4646
~~~~
4747
# #[allow(unused_imports)];
4848
# extern mod extra;
49-
use std::io::{BufferedReader, File};
49+
use std::io::buffered::BufferedReader;
50+
use std::io::File;
5051
# mod BufferedReader {
5152
# use std::io::File;
52-
# use std::io::MemReader;
53-
# use std::io::BufferedReader;
53+
# use std::io::mem::MemReader;
54+
# use std::io::buffered::BufferedReader;
5455
# static s : &'static [u8] = bytes!("1 2\n\
5556
# 34 56\n\
5657
# 789 123\n\
@@ -244,12 +245,13 @@ and trapping its exit status using `task::try`:
244245
~~~~
245246
# #[allow(unused_imports)];
246247
# extern mod extra;
247-
use std::io::{BufferedReader, File};
248+
use std::io::buffered::BufferedReader;
249+
use std::io::File;
248250
use std::task;
249251
# mod BufferedReader {
250252
# use std::io::File;
251-
# use std::io::MemReader;
252-
# use std::io::BufferedReader;
253+
# use std::io::mem::MemReader;
254+
# use std::io::buffered::BufferedReader;
253255
# static s : &'static [u8] = bytes!("1 2\n\
254256
# 34 56\n\
255257
# 789 123\n\
@@ -348,11 +350,12 @@ but similarly clear as the version that used `fail!` in the logic where the erro
348350
~~~~
349351
# #[allow(unused_imports)];
350352
# extern mod extra;
351-
use std::io::{BufferedReader, File};
353+
use std::io::buffered::BufferedReader;
354+
use std::io::File;
352355
# mod BufferedReader {
353356
# use std::io::File;
354-
# use std::io::MemReader;
355-
# use std::io::BufferedReader;
357+
# use std::io::mem::MemReader;
358+
# use std::io::buffered::BufferedReader;
356359
# static s : &'static [u8] = bytes!("1 2\n\
357360
# 34 56\n\
358361
# 789 123\n\
@@ -417,11 +420,12 @@ and replaces bad input lines with the pair `(-1,-1)`:
417420
~~~~
418421
# #[allow(unused_imports)];
419422
# extern mod extra;
420-
use std::io::{BufferedReader, File};
423+
use std::io::buffered::BufferedReader;
424+
use std::io::File;
421425
# mod BufferedReader {
422426
# use std::io::File;
423-
# use std::io::MemReader;
424-
# use std::io::BufferedReader;
427+
# use std::io::mem::MemReader;
428+
# use std::io::buffered::BufferedReader;
425429
# static s : &'static [u8] = bytes!("1 2\n\
426430
# 34 56\n\
427431
# 789 123\n\
@@ -492,11 +496,12 @@ Changing the condition's return type from `(int,int)` to `Option<(int,int)>` wil
492496
~~~~
493497
# #[allow(unused_imports)];
494498
# extern mod extra;
495-
use std::io::{BufferedReader, File};
499+
use std::io::buffered::BufferedReader;
500+
use std::io::File;
496501
# mod BufferedReader {
497502
# use std::io::File;
498-
# use std::io::MemReader;
499-
# use std::io::BufferedReader;
503+
# use std::io::mem::MemReader;
504+
# use std::io::buffered::BufferedReader;
500505
# static s : &'static [u8] = bytes!("1 2\n\
501506
# 34 56\n\
502507
# 789 123\n\
@@ -577,11 +582,12 @@ This can be encoded in the handler API by introducing a helper type: `enum Malfo
577582
~~~~
578583
# #[allow(unused_imports)];
579584
# extern mod extra;
585+
use std::io::buffered::BufferedReader;
580586
use std::io::File;
581587
# mod BufferedReader {
582588
# use std::io::File;
583-
# use std::io::MemReader;
584-
# use std::io::BufferedReader;
589+
# use std::io::mem::MemReader;
590+
# use std::io::buffered::BufferedReader;
585591
# static s : &'static [u8] = bytes!("1 2\n\
586592
# 34 56\n\
587593
# 789 123\n\
@@ -701,11 +707,12 @@ a second condition and a helper function will suffice:
701707
~~~~
702708
# #[allow(unused_imports)];
703709
# extern mod extra;
704-
use std::io::{BufferedReader, File};
710+
use std::io::buffered::BufferedReader;
711+
use std::io::File;
705712
# mod BufferedReader {
706713
# use std::io::File;
707-
# use std::io::MemReader;
708-
# use std::io::BufferedReader;
714+
# use std::io::mem::MemReader;
715+
# use std::io::buffered::BufferedReader;
709716
# static s : &'static [u8] = bytes!("1 2\n\
710717
# 34 56\n\
711718
# 789 123\n\

branches/snap-stage3/doc/guide-tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ be distributed on the available cores.
290290
fn partial_sum(start: uint) -> f64 {
291291
let mut local_sum = 0f64;
292292
for num in range(start*100000, (start+1)*100000) {
293-
local_sum += (num as f64 + 1.0).powf(&-2.0);
293+
local_sum += (num as f64 + 1.0).pow(&-2.0);
294294
}
295295
local_sum
296296
}
@@ -326,7 +326,7 @@ a single large vector of floats. Each task needs the full vector to perform its
326326
use extra::arc::Arc;
327327
328328
fn pnorm(nums: &~[f64], p: uint) -> f64 {
329-
nums.iter().fold(0.0, |a,b| a+(*b).powf(&(p as f64)) ).powf(&(1.0 / (p as f64)))
329+
nums.iter().fold(0.0, |a,b| a+(*b).pow(&(p as f64)) ).pow(&(1.0 / (p as f64)))
330330
}
331331
332332
fn main() {

branches/snap-stage3/mk/tests.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,9 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \
626626
--aux-base $$(S)src/test/auxiliary/ \
627627
--stage-id stage$(1)-$(2) \
628628
--target $(2) \
629-
--host $(3) \
630629
--adb-path=$(CFG_ADB) \
631630
--adb-test-dir=$(CFG_ADB_TEST_DIR) \
632-
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS)" \
631+
--rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) --target=$(2)" \
633632
$$(CTEST_TESTARGS)
634633

635634
CTEST_DEPS_rpass_$(1)-T-$(2)-H-$(3) = $$(RPASS_TESTS)

branches/snap-stage3/src/compiletest/common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@ pub struct config {
8686
// Target system to be tested
8787
target: ~str,
8888

89-
// Host triple for the compiler being invoked
90-
host: ~str,
91-
9289
// Extra parameter to run adb on arm-linux-androideabi
9390
adb_path: ~str,
9491

branches/snap-stage3/src/compiletest/compiletest.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ pub fn parse_config(args: ~[~str]) -> config {
7373
"percent change in metrics to consider noise", "N"),
7474
optflag("", "jit", "run tests under the JIT"),
7575
optopt("", "target", "the target to build for", "TARGET"),
76-
optopt("", "host", "the host to build for", "HOST"),
7776
optopt("", "adb-path", "path to the android debugger", "PATH"),
7877
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
7978
optopt("", "test-shard", "run shard A, of B shards, worth of the testsuite", "A.B"),
@@ -135,7 +134,6 @@ pub fn parse_config(args: ~[~str]) -> config {
135134
rustcflags: matches.opt_str("rustcflags"),
136135
jit: matches.opt_present("jit"),
137136
target: opt_str2(matches.opt_str("target")).to_str(),
138-
host: opt_str2(matches.opt_str("host")).to_str(),
139137
adb_path: opt_str2(matches.opt_str("adb-path")).to_str(),
140138
adb_test_dir:
141139
opt_str2(matches.opt_str("adb-test-dir")).to_str(),
@@ -169,7 +167,6 @@ pub fn log_config(config: &config) {
169167
logv(c, format!("rustcflags: {}", opt_str(&config.rustcflags)));
170168
logv(c, format!("jit: {}", config.jit));
171169
logv(c, format!("target: {}", config.target));
172-
logv(c, format!("host: {}", config.host));
173170
logv(c, format!("adb_path: {}", config.adb_path));
174171
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
175172
logv(c, format!("adb_device_status: {}", config.adb_device_status));

branches/snap-stage3/src/compiletest/errors.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::io::{BufferedReader, File};
11+
use std::io::buffered::BufferedReader;
12+
use std::io::File;
1213

1314
pub struct ExpectedError { line: uint, kind: ~str, msg: ~str }
1415

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ pub struct TestProps {
2828
debugger_cmds: ~[~str],
2929
// Lines to check if they appear in the expected debugger output
3030
check_lines: ~[~str],
31-
// Flag to force a crate to be built with the host architecture
32-
force_host: bool,
3331
}
3432

3533
// Load any test directives embedded in the file
@@ -41,7 +39,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
4139
let mut pp_exact = None;
4240
let mut debugger_cmds = ~[];
4341
let mut check_lines = ~[];
44-
let mut force_host = false;
4542
iter_header(testfile, |ln| {
4643
match parse_error_pattern(ln) {
4744
Some(ep) => error_patterns.push(ep),
@@ -56,10 +53,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
5653
pp_exact = parse_pp_exact(ln, testfile);
5754
}
5855

59-
if !force_host {
60-
force_host = parse_force_host(ln);
61-
}
62-
6356
match parse_aux_build(ln) {
6457
Some(ab) => { aux_builds.push(ab); }
6558
None => {}
@@ -89,8 +82,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
8982
aux_builds: aux_builds,
9083
exec_env: exec_env,
9184
debugger_cmds: debugger_cmds,
92-
check_lines: check_lines,
93-
force_host: force_host,
85+
check_lines: check_lines
9486
};
9587
}
9688

@@ -115,7 +107,8 @@ pub fn is_test_ignored(config: &config, testfile: &Path) -> bool {
115107
}
116108

117109
fn iter_header(testfile: &Path, it: |&str| -> bool) -> bool {
118-
use std::io::{BufferedReader, File};
110+
use std::io::buffered::BufferedReader;
111+
use std::io::File;
119112

120113
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
121114
for ln in rdr.lines() {
@@ -149,10 +142,6 @@ fn parse_check_line(line: &str) -> Option<~str> {
149142
parse_name_value_directive(line, ~"check")
150143
}
151144

152-
fn parse_force_host(line: &str) -> bool {
153-
parse_name_directive(line, "force-host")
154-
}
155-
156145
fn parse_exec_env(line: &str) -> Option<(~str, ~str)> {
157146
parse_name_value_directive(line, ~"exec-env").map(|nv| {
158147
// nv is either FOO or FOO=BAR

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,8 @@ fn compose_and_run_compiler(
691691

692692
for rel_ab in props.aux_builds.iter() {
693693
let abs_ab = config.aux_base.join(rel_ab.as_slice());
694-
let aux_props = load_props(&abs_ab);
695694
let aux_args =
696-
make_compile_args(config, &aux_props, ~[~"--lib"] + extra_link_args,
695+
make_compile_args(config, props, ~[~"--lib"] + extra_link_args,
697696
|a,b| make_lib_name(a, b, testfile), &abs_ab);
698697
let auxres = compose_and_run(config, &abs_ab, aux_args, ~[],
699698
config.compile_lib_path, None);
@@ -739,16 +738,10 @@ fn make_compile_args(config: &config,
739738
testfile: &Path)
740739
-> ProcArgs {
741740
let xform_file = xform(config, testfile);
742-
let target = if props.force_host {
743-
config.host.as_slice()
744-
} else {
745-
config.target.as_slice()
746-
};
747741
// FIXME (#9639): This needs to handle non-utf8 paths
748742
let mut args = ~[testfile.as_str().unwrap().to_owned(),
749743
~"-o", xform_file.as_str().unwrap().to_owned(),
750-
~"-L", config.build_base.as_str().unwrap().to_owned(),
751-
~"--target=" + target]
744+
~"-L", config.build_base.as_str().unwrap().to_owned()]
752745
+ extras;
753746
args.push_all_move(split_maybe_args(&config.rustcflags));
754747
args.push_all_move(split_maybe_args(&props.compile_flags));

branches/snap-stage3/src/libextra/ebml.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ pub mod writer {
590590
use std::clone::Clone;
591591
use std::io;
592592
use std::io::{Writer, Seek};
593-
use std::io::MemWriter;
593+
use std::io::mem::MemWriter;
594594
use std::io::extensions::u64_to_be_bytes;
595595

596596
// ebml writing
@@ -943,7 +943,7 @@ mod tests {
943943
use serialize::Encodable;
944944
use serialize;
945945

946-
use std::io::MemWriter;
946+
use std::io::mem::MemWriter;
947947
use std::option::{None, Option, Some};
948948

949949
#[test]

branches/snap-stage3/src/libextra/json.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use std::cast::transmute;
2121
use std::f64;
2222
use std::hashmap::HashMap;
2323
use std::io;
24-
use std::io::MemWriter;
24+
use std::io::mem::MemWriter;
2525
use std::num;
2626
use std::str;
2727
use std::to_str;
@@ -1506,7 +1506,7 @@ mod tests {
15061506
}
15071507
15081508
fn with_str_writer(f: |&mut io::Writer|) -> ~str {
1509-
use std::io::MemWriter;
1509+
use std::io::mem::MemWriter;
15101510
use std::str;
15111511
15121512
let mut m = MemWriter::new();

branches/snap-stage3/src/libextra/num/rational.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -653,19 +653,19 @@ mod test {
653653

654654
// f32
655655
test(3.14159265359f32, ("13176795", "4194304"));
656-
test(2f32.powf(&100.), ("1267650600228229401496703205376", "1"));
657-
test(-2f32.powf(&100.), ("-1267650600228229401496703205376", "1"));
658-
test(1.0 / 2f32.powf(&100.), ("1", "1267650600228229401496703205376"));
656+
test(2f32.pow(&100.), ("1267650600228229401496703205376", "1"));
657+
test(-2f32.pow(&100.), ("-1267650600228229401496703205376", "1"));
658+
test(1.0 / 2f32.pow(&100.), ("1", "1267650600228229401496703205376"));
659659
test(684729.48391f32, ("1369459", "2"));
660660
test(-8573.5918555f32, ("-4389679", "512"));
661661

662662
// f64
663663
test(3.14159265359f64, ("3537118876014453", "1125899906842624"));
664-
test(2f64.powf(&100.), ("1267650600228229401496703205376", "1"));
665-
test(-2f64.powf(&100.), ("-1267650600228229401496703205376", "1"));
664+
test(2f64.pow(&100.), ("1267650600228229401496703205376", "1"));
665+
test(-2f64.pow(&100.), ("-1267650600228229401496703205376", "1"));
666666
test(684729.48391f64, ("367611342500051", "536870912"));
667667
test(-8573.5918555, ("-4713381968463931", "549755813888"));
668-
test(1.0 / 2f64.powf(&100.), ("1", "1267650600228229401496703205376"));
668+
test(1.0 / 2f64.pow(&100.), ("1", "1267650600228229401496703205376"));
669669
}
670670

671671
#[test]

branches/snap-stage3/src/libextra/stats.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ pub fn write_boxplot(w: &mut io::Writer, s: &Summary, width_hint: uint) {
349349
let (q1,q2,q3) = s.quartiles;
350350

351351
// the .abs() handles the case where numbers are negative
352-
let lomag = (10.0_f64).powf(&(s.min.abs().log10().floor()));
353-
let himag = (10.0_f64).powf(&(s.max.abs().log10().floor()));
352+
let lomag = (10.0_f64).pow(&(s.min.abs().log10().floor()));
353+
let himag = (10.0_f64).pow(&(s.max.abs().log10().floor()));
354354

355355
// need to consider when the limit is zero
356356
let lo = if lomag == 0.0 {
@@ -998,7 +998,7 @@ mod tests {
998998
#[test]
999999
fn test_boxplot_nonpositive() {
10001000
fn t(s: &Summary, expected: ~str) {
1001-
use std::io::MemWriter;
1001+
use std::io::mem::MemWriter;
10021002
let mut m = MemWriter::new();
10031003
write_boxplot(&mut m as &mut io::Writer, s, 30);
10041004
let out = str::from_utf8_owned(m.unwrap());

branches/snap-stage3/src/libextra/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ pub fn run_tests_console(opts: &TestOpts,
673673

674674
#[test]
675675
fn should_sort_failures_before_printing_them() {
676-
use std::io::MemWriter;
676+
use std::io::mem::MemWriter;
677677
use std::str;
678678

679679
let test_a = TestDesc {

branches/snap-stage3/src/libextra/time.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
#[allow(missing_doc)];
1212

13-
use std::io::BufReader;
13+
use std::io::Reader;
14+
use std::io::mem::BufReader;
1415
use std::libc;
1516
use std::num;
1617
use std::str;

0 commit comments

Comments
 (0)