Skip to content

Commit e23cdab

Browse files
committed
---
yaml --- r: 151755 b: refs/heads/try2 c: 161b50a h: refs/heads/master i: 151753: 75745c1 151751: 5496764 v: v3
1 parent 23eff9e commit e23cdab

File tree

210 files changed

+3472
-5411
lines changed

Some content is hidden

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

210 files changed

+3472
-5411
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: d92926ca3b984d7f58b685322083ff309f73c0bd
8+
refs/heads/try2: 161b50a8e63ea4fd92d42750c6e0feaed269a92e
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#
6969
# * `TESTNAME=...` - Specify the name of tests to run
7070
# * `CHECK_IGNORED=1` - Run normally-ignored tests
71-
# * `PLEASE_BENCH=1` - Run crate benchmarks (enable `--bench` flag)
71+
# * `NO_BENCH=1` - Don't run crate benchmarks (disable `--bench` flag)
7272
#
7373
# * `CFG_ENABLE_VALGRIND=1` - Run tests under valgrind
7474
# * `VALGRIND_COMPILE=1` - Run the compiler itself under valgrind

branches/try2/mk/crates.mk

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,19 @@
5151

5252
TARGET_CRATES := libc std green rustuv native flate arena glob term semver \
5353
uuid serialize sync getopts collections num test time rand \
54-
workcache url log regex graphviz core rlibc
54+
workcache url log regex graphviz core
5555
HOST_CRATES := syntax rustc rustdoc fourcc hexfloat regex_macros fmt_macros
5656
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
5757
TOOLS := compiletest rustdoc rustc
5858

5959
DEPS_core :=
60-
DEPS_rlibc :=
6160
DEPS_std := core libc native:rustrt native:compiler-rt native:backtrace native:jemalloc
62-
DEPS_graphviz := std
6361
DEPS_green := std rand native:context_switch
6462
DEPS_rustuv := std native:uv native:uv_support
6563
DEPS_native := std
6664
DEPS_syntax := std term serialize collections log fmt_macros
6765
DEPS_rustc := syntax native:rustllvm flate arena serialize sync getopts \
68-
collections time log graphviz
66+
collections time log
6967
DEPS_rustdoc := rustc native:hoedown serialize sync getopts collections \
7068
test time
7169
DEPS_flate := std native:miniz
@@ -100,7 +98,6 @@ TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
10098
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
10199

102100
ONLY_RLIB_core := 1
103-
ONLY_RLIB_rlibc := 1
104101

105102
################################################################################
106103
# You should not need to edit below this line

branches/try2/mk/docs.mk

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ DOCS := index intro tutorial guide-ffi guide-macros guide-lifetimes \
3030
guide-tasks guide-container guide-pointers guide-testing \
3131
guide-runtime complement-bugreport complement-cheatsheet \
3232
complement-lang-faq complement-project-faq rust rustdoc \
33-
guide-unsafe
33+
guide-unsafe not_found
3434

3535
PDF_DOCS := tutorial rust
3636

@@ -42,11 +42,10 @@ L10N_LANGS := ja
4242
# Generally no need to edit below here.
4343

4444
# The options are passed to the documentation generators.
45-
RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
45+
RUSTDOC_HTML_OPTS = --markdown-css rust.css \
46+
--markdown-before-content=doc/version_info.html \
4647
--markdown-in-header=doc/favicon.inc --markdown-after-content=doc/footer.inc
4748

48-
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
49-
5049
PANDOC_BASE_OPTS := --standalone --toc --number-sections
5150
PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.tex \
5251
--from=markdown --include-before-body=doc/footer.tex --to=latex
@@ -153,11 +152,6 @@ doc/footer.tex: $(D)/footer.inc | doc/
153152
@$(call E, pandoc: $@)
154153
$(CFG_PANDOC) --from=html --to=latex $< --output=$@
155154

156-
# HTML (rustdoc)
157-
DOC_TARGETS += doc/not_found.html
158-
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
159-
$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css http://static.rust-lang.org/doc/master/rust.css $<
160-
161155
define DEF_DOC
162156

163157
# HTML (rustdoc)

branches/try2/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ $$(JEMALLOC_LIB_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
261261
AR="$$(AR_$(1))" \
262262
RANLIB="$$(AR_$(1)) s" \
263263
CPPFLAGS="-I $(S)src/rt/" \
264-
EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1))"
264+
EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1)) -g1"
265265
$$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
266266
$$(Q)cp $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1)) $$(JEMALLOC_LIB_$(1))
267267

branches/try2/mk/tests.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ ifdef CHECK_IGNORED
3232
TESTARGS += --ignored
3333
endif
3434

35-
TEST_BENCH =
35+
TEST_BENCH = --bench
3636

3737
# Arguments to the cfail/rfail/rpass/bench tests
3838
ifdef CFG_VALGRIND
3939
CTEST_RUNTOOL = --runtool "$(CFG_VALGRIND)"
4040
TEST_BENCH =
4141
endif
4242

43-
ifdef PLEASE_BENCH
44-
TEST_BENCH = --bench
43+
ifdef NO_BENCH
44+
TEST_BENCH =
4545
endif
4646

4747
# Arguments to the perf tests

branches/try2/src/compiletest/common.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@ impl FromStr for Mode {
4141
impl fmt::Show for Mode {
4242
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4343
let msg = match *self {
44-
CompileFail => "compile-fail",
45-
RunFail => "run-fail",
46-
RunPass => "run-pass",
47-
Pretty => "pretty",
48-
DebugInfoGdb => "debuginfo-gdb",
49-
DebugInfoLldb => "debuginfo-lldb",
50-
Codegen => "codegen",
44+
CompileFail => "compile-fail",
45+
RunFail => "run-fail",
46+
RunPass => "run-pass",
47+
Pretty => "pretty",
48+
DebugInfoGdb => "debuginfo-gdb",
49+
DebugInfoLldb => "debuginfo-lldb",
50+
Codegen => "codegen",
5151
};
52-
msg.fmt(f)
52+
write!(f.buf, "{}", msg)
5353
}
5454
}
5555

branches/try2/src/doc/complement-cheatsheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ To return an Owned String (~str) use the str helper function [`from_utf8_owned`]
6060
~~~
6161
use std::str;
6262
63-
let x: Result<~str,~[u8]> = str::from_utf8_owned(~[104u8,105u8]);
63+
let x: Option<~str> = str::from_utf8_owned(~[104u8,105u8]);
6464
let y: ~str = x.unwrap();
6565
~~~
6666

branches/try2/src/doc/guide-tasks.md

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,12 @@ fn main() {
343343
let numbers_arc = Arc::new(numbers);
344344
345345
for num in range(1u, 10) {
346-
let task_numbers = numbers_arc.clone();
346+
let (tx, rx) = channel();
347+
tx.send(numbers_arc.clone());
347348
348349
spawn(proc() {
350+
let local_arc : Arc<Vec<f64>> = rx.recv();
351+
let task_numbers = &*local_arc;
349352
println!("{}-norm = {}", num, pnorm(task_numbers.as_slice(), num));
350353
});
351354
}
@@ -366,27 +369,40 @@ let numbers_arc=Arc::new(numbers);
366369
# }
367370
~~~
368371

369-
and a unique clone is captured for each task via a procedure. This only copies the wrapper and not
370-
it's contents. Within the task's procedure, the captured Arc reference can be used as an immutable
371-
reference to the underlying vector as if it were local.
372+
and a clone of it is sent to each task
372373

373374
~~~
374375
# extern crate sync;
375376
# extern crate rand;
376377
# use sync::Arc;
377-
# fn pnorm(nums: &[f64], p: uint) -> f64 { 4.0 }
378378
# fn main() {
379379
# let numbers=Vec::from_fn(1000000, |_| rand::random::<f64>());
380380
# let numbers_arc = Arc::new(numbers);
381-
# let num = 4;
382-
let task_numbers = numbers_arc.clone();
383-
spawn(proc() {
384-
// Capture task_numbers and use it as if it was the underlying vector
385-
println!("{}-norm = {}", num, pnorm(task_numbers.as_slice(), num));
386-
});
381+
# let (tx, rx) = channel();
382+
tx.send(numbers_arc.clone());
383+
# }
384+
~~~
385+
386+
copying only the wrapper and not its contents.
387+
388+
Each task recovers the underlying data by
389+
390+
~~~
391+
# extern crate sync;
392+
# extern crate rand;
393+
# use sync::Arc;
394+
# fn main() {
395+
# let numbers=Vec::from_fn(1000000, |_| rand::random::<f64>());
396+
# let numbers_arc=Arc::new(numbers);
397+
# let (tx, rx) = channel();
398+
# tx.send(numbers_arc.clone());
399+
# let local_arc : Arc<Vec<f64>> = rx.recv();
400+
let task_numbers = &*local_arc;
387401
# }
388402
~~~
389403

404+
and can use it as if it were local.
405+
390406
The `arc` module also implements Arcs around mutable data that are not covered here.
391407

392408
# Handling task failure

branches/try2/src/doc/rust.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,8 +1799,6 @@ type int8_t = i8;
17991799
- `no_start` - disable linking to the `native` crate, which specifies the
18001800
"start" language item.
18011801
- `no_std` - disable linking to the `std` crate.
1802-
- `no_builtins` - disable optimizing certain code patterns to invocations of
1803-
library functions that are assumed to exist
18041802

18051803
### Module-only attributes
18061804

branches/try2/src/libcollections/btree.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -425,8 +425,8 @@ impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for Leaf<K, V> {
425425
///Returns a string representation of a Leaf.
426426
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
427427
for (i, s) in self.elts.iter().enumerate() {
428-
if i != 0 { try!(write!(f, " // ")) }
429-
try!(write!(f, "{}", *s))
428+
if i != 0 { try!(write!(f.buf, " // ")) }
429+
try!(write!(f.buf, "{}", *s))
430430
}
431431
Ok(())
432432
}
@@ -654,10 +654,10 @@ impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for Branch<K, V> {
654654
///Returns a string representation of a Branch.
655655
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
656656
for (i, s) in self.elts.iter().enumerate() {
657-
if i != 0 { try!(write!(f, " // ")) }
658-
try!(write!(f, "{}", *s))
657+
if i != 0 { try!(write!(f.buf, " // ")) }
658+
try!(write!(f.buf, "{}", *s))
659659
}
660-
write!(f, " // rightmost child: ({}) ", *self.rightmost_child)
660+
write!(f.buf, " // rightmost child: ({}) ", *self.rightmost_child)
661661
}
662662
}
663663

@@ -715,7 +715,7 @@ impl<K: TotalOrd, V: TotalEq> TotalOrd for LeafElt<K, V> {
715715
impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for LeafElt<K, V> {
716716
///Returns a string representation of a LeafElt.
717717
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
718-
write!(f, "Key: {}, value: {};", self.key, self.value)
718+
write!(f.buf, "Key: {}, value: {};", self.key, self.value)
719719
}
720720
}
721721

@@ -765,7 +765,7 @@ impl<K: fmt::Show + TotalOrd, V: fmt::Show> fmt::Show for BranchElt<K, V> {
765765
/// Returns string containing key, value, and child (which should recur to a
766766
/// leaf) Consider changing in future to be more readable.
767767
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
768-
write!(f, "Key: {}, value: {}, (child: {})",
768+
write!(f.buf, "Key: {}, value: {}, (child: {})",
769769
self.key, self.value, *self.left)
770770
}
771771
}

0 commit comments

Comments
 (0)