Skip to content

Commit 3c8beeb

Browse files
committed
---
yaml --- r: 95662 b: refs/heads/dist-snap c: 950add4 h: refs/heads/master v: v3
1 parent 1cc96c7 commit 3c8beeb

File tree

156 files changed

+4642
-5637
lines changed

Some content is hidden

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

156 files changed

+4642
-5637
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 9a773da681a92c599f7b56f66f79bc107eeadbee
9+
refs/heads/dist-snap: 950add4e49cc2ac5d60abd6da969392123ddcce0
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
branch = master
99
[submodule "src/gyp"]
1010
path = src/gyp
11-
url = https://git.chromium.org/external/gyp.git
11+
url = https://github.com/brson/gyp.git

branches/dist-snap/doc/tutorial-conditions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ $ ./example numbers.txt
4343

4444
An example program that does this task reads like this:
4545

46-
~~~~
46+
~~~~{.xfail-test}
4747
# #[allow(unused_imports)];
4848
extern mod extra;
4949
use extra::fileinput::FileInput;
@@ -430,7 +430,7 @@ To trap a condition, use `Condition::trap` in some caller of the site that calls
430430
For example, this version of the program traps the `malformed_line` condition
431431
and replaces bad input lines with the pair `(-1,-1)`:
432432

433-
~~~~
433+
~~~~{.xfail-test}
434434
# #[allow(unused_imports)];
435435
extern mod extra;
436436
use extra::fileinput::FileInput;
@@ -507,7 +507,7 @@ In the example program, the first form of the `malformed_line` API implicitly as
507507
This assumption may not be correct; some callers may wish to skip malformed lines, for example.
508508
Changing the condition's return type from `(int,int)` to `Option<(int,int)>` will suffice to support this type of recovery:
509509

510-
~~~~
510+
~~~~{.xfail-test}
511511
# #[allow(unused_imports)];
512512
extern mod extra;
513513
use extra::fileinput::FileInput;
@@ -594,7 +594,7 @@ until all relevant combinations encountered in practice are encoded.
594594
In the example, suppose a third possible recovery form arose: reusing the previous value read.
595595
This can be encoded in the handler API by introducing a helper type: `enum MalformedLineFix`.
596596

597-
~~~~
597+
~~~~{.xfail-test}
598598
# #[allow(unused_imports)];
599599
extern mod extra;
600600
use extra::fileinput::FileInput;
@@ -720,7 +720,7 @@ task <unnamed> failed at 'called `Option::unwrap()` on a `None` value', .../libs
720720
To make the program robust -- or at least flexible -- in the face of this potential failure,
721721
a second condition and a helper function will suffice:
722722

723-
~~~~
723+
~~~~{.xfail-test}
724724
# #[allow(unused_imports)];
725725
extern mod extra;
726726
use extra::fileinput::FileInput;

branches/dist-snap/doc/tutorial-tasks.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ calling the `spawn` function with a closure argument. `spawn` executes the
6969
closure in the new task.
7070

7171
~~~~
72-
# use std::io::println;
7372
# use std::task::spawn;
7473
7574
// Print something profound in a different task using a named function

branches/dist-snap/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2907,12 +2907,12 @@ you just have to import it with an `use` statement.
29072907
For example, it re-exports `println` which is defined in `std::io::println`:
29082908

29092909
~~~
2910-
use puts = std::io::println;
2910+
use puts = std::rt::io::stdio::println;
29112911
29122912
fn main() {
29132913
println("println is imported per default.");
29142914
puts("Doesn't hinder you from importing it under an different name yourself.");
2915-
::std::io::println("Or from not using the automatic import.");
2915+
::std::rt::io::stdio::println("Or from not using the automatic import.");
29162916
}
29172917
~~~
29182918

branches/dist-snap/mk/install.mk

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ else
2323
INSTALL = $(Q)$(call E, install: $(2)/$(3)) && install -m755 $(1)/$(3) $(2)/$(3)
2424
endif
2525

26+
# For MK_INSTALL_DIR
27+
# $(1) is the directory to create
28+
MK_INSTALL_DIR = (umask 022 && mkdir -p $(1))
29+
2630
# For INSTALL_LIB,
2731
# Target-specific $(LIB_SOURCE_DIR) is the source directory
2832
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
@@ -83,7 +87,7 @@ define INSTALL_TARGET_N
8387
install-target-$(1)-host-$(2): LIB_SOURCE_DIR=$$(TL$(1)$(2))
8488
install-target-$(1)-host-$(2): LIB_DESTIN_DIR=$$(PTL$(1)$(2))
8589
install-target-$(1)-host-$(2): $$(TSREQ$$(ISTAGE)_T_$(1)_H_$(2)) $$(SREQ$$(ISTAGE)_T_$(1)_H_$(2))
86-
$$(Q)mkdir -p $$(PTL$(1)$(2))
90+
$$(Q)$$(call MK_INSTALL_DIR,$$(PTL$(1)$(2)))
8791
$$(Q)$$(call INSTALL_LIB,$$(CFG_RUNTIME_$(1)))
8892
$$(Q)$$(call INSTALL_LIB,$$(STDLIB_GLOB_$(1)))
8993
$$(Q)$$(call INSTALL_LIB,$$(EXTRALIB_GLOB_$(1)))
@@ -95,7 +99,7 @@ define INSTALL_HOST_N
9599
install-target-$(1)-host-$(2): LIB_SOURCE_DIR=$$(TL$(1)$(2))
96100
install-target-$(1)-host-$(2): LIB_DESTIN_DIR=$$(PTL$(1)$(2))
97101
install-target-$(1)-host-$(2): $$(CSREQ$$(ISTAGE)_T_$(1)_H_$(2))
98-
$$(Q)mkdir -p $$(PTL$(1)$(2))
102+
$$(Q)$$(call MK_INSTALL_DIR,$$(PTL$(1)$(2)))
99103
$$(Q)$$(call INSTALL_LIB,$$(CFG_RUNTIME_$(1)))
100104
$$(Q)$$(call INSTALL_LIB,$$(CFG_RUSTLLVM_$(1)))
101105
$$(Q)$$(call INSTALL_LIB,$$(STDLIB_GLOB_$(1)))
@@ -131,9 +135,9 @@ PHL = $(PREFIX_LIB)
131135
install-host: LIB_SOURCE_DIR=$(HL)
132136
install-host: LIB_DESTIN_DIR=$(PHL)
133137
install-host: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD_TRIPLE)_H_$(CFG_BUILD_TRIPLE))
134-
$(Q)mkdir -p $(PREFIX_BIN)
135-
$(Q)mkdir -p $(PREFIX_LIB)
136-
$(Q)mkdir -p $(PREFIX_ROOT)/share/man/man1
138+
$(Q)$(call MK_INSTALL_DIR,$(PREFIX_BIN))
139+
$(Q)$(call MK_INSTALL_DIR,$(PREFIX_LIB))
140+
$(Q)$(call MK_INSTALL_DIR,$(PREFIX_ROOT)/share/man/man1)
137141
$(Q)$(call INSTALL,$(HB2),$(PHB),rustc$(X_$(CFG_BUILD_TRIPLE)))
138142
$(Q)$(call INSTALL,$(HB2),$(PHB),rustpkg$(X_$(CFG_BUILD_TRIPLE)))
139143
$(Q)$(call INSTALL,$(HB2),$(PHB),rustdoc$(X_$(CFG_BUILD_TRIPLE)))

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

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ use util;
2121
use util::logv;
2222

2323
use std::cell::Cell;
24-
use std::io;
24+
use std::rt::io;
25+
use std::rt::io::Writer;
26+
use std::rt::io::extensions::ReaderUtil;
27+
use std::rt::io::file::FileInfo;
2528
use std::os;
2629
use std::str;
2730
use std::task::{spawn_sched, SingleThreaded};
@@ -60,7 +63,7 @@ pub fn run(config: config, testfile: ~str) {
6063
pub fn run_metrics(config: config, testfile: ~str, mm: &mut MetricMap) {
6164
if config.verbose {
6265
// We're going to be dumping a lot of info. Start on a new line.
63-
io::stdout().write_str("\n\n");
66+
print!("\n\n");
6467
}
6568
let testfile = Path::new(testfile);
6669
debug!("running {}", testfile.display());
@@ -170,7 +173,9 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
170173
let rounds =
171174
match props.pp_exact { Some(_) => 1, None => 2 };
172175

173-
let mut srcs = ~[io::read_whole_file_str(testfile).unwrap()];
176+
let src = testfile.open_reader(io::Open).read_to_end();
177+
let src = str::from_utf8_owned(src);
178+
let mut srcs = ~[src];
174179

175180
let mut round = 0;
176181
while round < rounds {
@@ -190,7 +195,8 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
190195
let mut expected = match props.pp_exact {
191196
Some(ref file) => {
192197
let filepath = testfile.dir_path().join(file);
193-
io::read_whole_file_str(&filepath).unwrap()
198+
let s = filepath.open_reader(io::Open).read_to_end();
199+
str::from_utf8_owned(s)
194200
}
195201
None => { srcs[srcs.len() - 2u].clone() }
196202
};
@@ -228,8 +234,7 @@ fn run_pretty_test(config: &config, props: &TestProps, testfile: &Path) {
228234
fn compare_source(expected: &str, actual: &str) {
229235
if expected != actual {
230236
error(~"pretty-printed source does not match expected source");
231-
let msg =
232-
format!("\n\
237+
println!("\n\
233238
expected:\n\
234239
------------------------------------------\n\
235240
{}\n\
@@ -240,7 +245,6 @@ actual:\n\
240245
------------------------------------------\n\
241246
\n",
242247
expected, actual);
243-
io::stdout().write_str(msg);
244248
fail!();
245249
}
246250
}
@@ -741,9 +745,7 @@ fn dump_output(config: &config, testfile: &Path, out: &str, err: &str) {
741745
fn dump_output_file(config: &config, testfile: &Path,
742746
out: &str, extension: &str) {
743747
let outfile = make_out_name(config, testfile, extension);
744-
let writer =
745-
io::file_writer(&outfile, [io::Create, io::Truncate]).unwrap();
746-
writer.write_str(out);
748+
outfile.open_writer(io::CreateOrTruncate).write(out.as_bytes());
747749
}
748750

749751
fn make_out_name(config: &config, testfile: &Path, extension: &str) -> Path {
@@ -771,24 +773,20 @@ fn output_base_name(config: &config, testfile: &Path) -> Path {
771773

772774
fn maybe_dump_to_stdout(config: &config, out: &str, err: &str) {
773775
if config.verbose {
774-
let sep1 = format!("------{}------------------------------", "stdout");
775-
let sep2 = format!("------{}------------------------------", "stderr");
776-
let sep3 = ~"------------------------------------------";
777-
io::stdout().write_line(sep1);
778-
io::stdout().write_line(out);
779-
io::stdout().write_line(sep2);
780-
io::stdout().write_line(err);
781-
io::stdout().write_line(sep3);
776+
println!("------{}------------------------------", "stdout");
777+
println!("{}", out);
778+
println!("------{}------------------------------", "stderr");
779+
println!("{}", err);
780+
println!("------------------------------------------");
782781
}
783782
}
784783

785-
fn error(err: ~str) { io::stdout().write_line(format!("\nerror: {}", err)); }
784+
fn error(err: ~str) { println!("\nerror: {}", err); }
786785

787786
fn fatal(err: ~str) -> ! { error(err); fail!(); }
788787

789788
fn fatal_ProcRes(err: ~str, ProcRes: &ProcRes) -> ! {
790-
let msg =
791-
format!("\n\
789+
print!("\n\
792790
error: {}\n\
793791
command: {}\n\
794792
stdout:\n\
@@ -801,7 +799,6 @@ stderr:\n\
801799
------------------------------------------\n\
802800
\n",
803801
err, ProcRes.cmdline, ProcRes.stdout, ProcRes.stderr);
804-
io::stdout().write_str(msg);
805802
fail!();
806803
}
807804

@@ -821,9 +818,9 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
821818
~[(~"",~"")], Some(~""));
822819

823820
if config.verbose {
824-
io::stdout().write_str(format!("push ({}) {} {} {}",
821+
println!("push ({}) {} {} {}",
825822
config.target, args.prog,
826-
copy_result.out, copy_result.err));
823+
copy_result.out, copy_result.err);
827824
}
828825

829826
logv(config, format!("executing ({}) {}", config.target, cmdline));
@@ -913,9 +910,9 @@ fn _arm_push_aux_shared_library(config: &config, testfile: &Path) {
913910
~[(~"",~"")], Some(~""));
914911

915912
if config.verbose {
916-
io::stdout().write_str(format!("push ({}) {} {} {}",
913+
println!("push ({}) {} {} {}",
917914
config.target, file.display(),
918-
copy_result.out, copy_result.err));
915+
copy_result.out, copy_result.err);
919916
}
920917
}
921918
}
@@ -999,7 +996,8 @@ fn disassemble_extract(config: &config, _props: &TestProps,
999996

1000997

1001998
fn count_extracted_lines(p: &Path) -> uint {
1002-
let x = io::read_whole_file_str(&p.with_extension("ll")).unwrap();
999+
let x = p.with_extension("ll").open_reader(io::Open).read_to_end();
1000+
let x = str::from_utf8_owned(x);
10031001
x.line_iter().len()
10041002
}
10051003

branches/dist-snap/src/compiletest/util.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use common::config;
1212

13-
use std::io;
1413
use std::os::getenv;
1514

1615
/// Conversion table from triple OS name to Rust SYSNAME
@@ -64,5 +63,5 @@ pub fn path_div() -> ~str { ~";" }
6463
6564
pub fn logv(config: &config, s: ~str) {
6665
debug!("{}", s);
67-
if config.verbose { io::println(s); }
66+
if config.verbose { println(s); }
6867
}

branches/dist-snap/src/etc/combine-tests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ def scrub(b):
5656
d.write("extern mod extra;\n")
5757
d.write("extern mod run_pass_stage2;\n")
5858
d.write("use run_pass_stage2::*;\n")
59-
d.write("use std::io::WriterUtil;\n");
60-
d.write("use std::io;\n");
59+
d.write("use std::rt::io;\n");
60+
d.write("use std::rt::io::Writer;\n");
6161
d.write("fn main() {\n");
62-
d.write(" let out = io::stdout();\n");
62+
d.write(" let mut out = io::stdout();\n");
6363
i = 0
6464
for t in stage2_tests:
6565
p = os.path.join("test", "run-pass", t)
6666
p = p.replace("\\", "\\\\")
67-
d.write(" out.write_str(\"run-pass [stage2]: %s\\n\");\n" % p)
67+
d.write(" out.write(\"run-pass [stage2]: %s\\n\".as_bytes());\n" % p)
6868
d.write(" t_%d::main();\n" % i)
6969
i += 1
7070
d.write("}\n")

branches/dist-snap/src/libextra/arc.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,12 @@ pub struct Arc<T> { priv x: UnsafeArc<T> }
117117
*/
118118
impl<T:Freeze+Send> Arc<T> {
119119
/// Create an atomically reference counted wrapper.
120+
#[inline]
120121
pub fn new(data: T) -> Arc<T> {
121122
Arc { x: UnsafeArc::new(data) }
122123
}
123124

125+
#[inline]
124126
pub fn get<'a>(&'a self) -> &'a T {
125127
unsafe { &*self.x.get_immut() }
126128
}
@@ -148,6 +150,7 @@ impl<T:Freeze + Send> Clone for Arc<T> {
148150
* object. However, one of the `arc` objects can be sent to another task,
149151
* allowing them to share the underlying data.
150152
*/
153+
#[inline]
151154
fn clone(&self) -> Arc<T> {
152155
Arc { x: self.x.clone() }
153156
}
@@ -167,6 +170,7 @@ pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
167170

168171
impl<T:Send> Clone for MutexArc<T> {
169172
/// Duplicate a mutex-protected Arc. See arc::clone for more details.
173+
#[inline]
170174
fn clone(&self) -> MutexArc<T> {
171175
// NB: Cloning the underlying mutex is not necessary. Its reference
172176
// count would be exactly the same as the shared state's.
@@ -349,6 +353,7 @@ pub struct RWArc<T> {
349353

350354
impl<T:Freeze + Send> Clone for RWArc<T> {
351355
/// Duplicate a rwlock-protected Arc. See arc::clone for more details.
356+
#[inline]
352357
fn clone(&self) -> RWArc<T> {
353358
RWArc { x: self.x.clone() }
354359
}

branches/dist-snap/src/libextra/comm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ pub fn rendezvous<T: Send>() -> (SyncPort<T>, SyncChan<T>) {
136136
#[cfg(test)]
137137
mod test {
138138
use comm::{DuplexStream, rendezvous};
139-
use std::rt::test::run_in_newsched_task;
139+
use std::rt::test::run_in_uv_task;
140140
use std::task::spawn_unlinked;
141141

142142

@@ -165,7 +165,7 @@ mod test {
165165
#[test]
166166
fn recv_a_lot() {
167167
// Rendezvous streams should be able to handle any number of messages being sent
168-
do run_in_newsched_task {
168+
do run_in_uv_task {
169169
let (port, chan) = rendezvous();
170170
do spawn {
171171
do 1000000.times { chan.send(()) }

0 commit comments

Comments
 (0)