Skip to content

Commit a797a98

Browse files
author
blake2-ppc
committed
---
yaml --- r: 86013 b: refs/heads/dist-snap c: 04845f0 h: refs/heads/master i: 86011: 2ef94f7 v: v3
1 parent fa7a4f0 commit a797a98

File tree

216 files changed

+2021
-2614
lines changed

Some content is hidden

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

216 files changed

+2021
-2614
lines changed

[refs]

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

branches/dist-snap/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ break
209209
do
210210
else enum extern
211211
false fn for
212-
if impl in
212+
if impl
213213
let loop
214214
match mod mut
215215
priv pub

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

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,14 @@ impl Iterator<int> for ZeroStream {
105105
}
106106
~~~
107107
108-
In general, you cannot rely on the behavior of the `next()` method after it has
109-
returned `None`. Some iterators may return `None` forever. Others may behave
110-
differently.
111-
112108
## Container iterators
113109
114110
Containers implement iteration over the contained elements by returning an
115111
iterator object. For example, vector slices several iterators available:
116112
117113
* `iter()` and `rev_iter()`, for immutable references to the elements
118114
* `mut_iter()` and `mut_rev_iter()`, for mutable references to the elements
119-
* `move_iter()` and `move_rev_iter()`, to move the elements out by-value
115+
* `move_iter()` and `move_rev_iter`, to move the elements out by-value
120116
121117
A typical mutable container will implement at least `iter()`, `mut_iter()` and
122118
`move_iter()` along with the reverse variants if it maintains an order.
@@ -153,7 +149,7 @@ let result = xs.iter().fold(0, |accumulator, item| accumulator - *item);
153149
assert_eq!(result, -41);
154150
~~~
155151
156-
Most adaptors return an adaptor object implementing the `Iterator` trait itself:
152+
Some adaptors return an adaptor object implementing the `Iterator` trait itself:
157153
158154
~~~
159155
let xs = [1, 9, 2, 3, 14, 12];
@@ -162,35 +158,6 @@ let sum = xs.iter().chain(ys.iter()).fold(0, |a, b| a + *b);
162158
assert_eq!(sum, 57);
163159
~~~
164160
165-
Some iterator adaptors may return `None` before exhausting the underlying
166-
iterator. Additionally, if these iterator adaptors are called again after
167-
returning `None`, they may call their underlying iterator again even if the
168-
adaptor will continue to return `None` forever. This may not be desired if the
169-
underlying iterator has side-effects.
170-
171-
In order to provide a guarantee about behavior once `None` has been returned, an
172-
iterator adaptor named `fuse()` is provided. This returns an iterator that will
173-
never call its underlying iterator again once `None` has been returned:
174-
175-
~~~
176-
let xs = [1,2,3,4,5];
177-
let mut calls = 0;
178-
let it = xs.iter().scan((), |_, x| {
179-
calls += 1;
180-
if *x < 3 { Some(x) } else { None }});
181-
// the iterator will only yield 1 and 2 before returning None
182-
// If we were to call it 5 times, calls would end up as 5, despite only 2 values
183-
// being yielded (and therefore 3 unique calls being made). The fuse() adaptor
184-
// can fix this.
185-
let mut it = it.fuse();
186-
it.next();
187-
it.next();
188-
it.next();
189-
it.next();
190-
it.next();
191-
assert_eq!(calls, 3);
192-
~~~
193-
194161
## For loops
195162
196163
The function `range` (or `range_inclusive`) allows to simply iterate through a given range:

branches/dist-snap/mk/stage0.mk

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ $(HBIN0_H_$(CFG_BUILD_TRIPLE))/:
66
$(HLIB0_H_$(CFG_BUILD_TRIPLE))/:
77
mkdir -p $@
88

9-
SNAPSHOT_RUSTC_POST_CLEANUP=$(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE))
10-
11-
$(SNAPSHOT_RUSTC_POST_CLEANUP): \
9+
$(HBIN0_H_$(CFG_BUILD_TRIPLE))/rustc$(X_$(CFG_BUILD_TRIPLE)): \
1210
$(S)src/snapshots.txt \
1311
$(S)src/etc/get-snapshot.py $(MKFILE_DEPS) \
1412
| $(HBIN0_H_$(CFG_BUILD_TRIPLE))/

branches/dist-snap/mk/target.mk

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,18 @@ WFLAGS_ST2 = -D warnings
2727
# $(2) is the target triple
2828
# $(3) is the host triple
2929

30-
# Every recipe in TARGET_STAGE_N outputs to $$(TLIB$(1)_T_$(2)_H_$(3),
31-
# a directory that can be cleaned out during the middle of a run of
32-
# the get-snapshot.py script. Therefore, every recipe needs to have
33-
# an order-only dependency either on $(SNAPSHOT_RUSTC_POST_CLEANUP) or
34-
# on $$(TSREQ$(1)_T_$(2)_H_$(3)), to ensure that no products will be
35-
# put into the target area until after the get-snapshot.py script has
36-
# had its chance to clean it out; otherwise the other products will be
37-
# inadvertantly included in the clean out.
3830

3931
define TARGET_STAGE_N
4032

4133
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
4234
rt/$(2)/stage$(1)/arch/$$(HOST_$(2))/libmorestack.a \
43-
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
44-
$(SNAPSHOT_RUSTC_POST_CLEANUP)
35+
| $$(TLIB$(1)_T_$(2)_H_$(3))/
4536
@$$(call E, cp: $$@)
4637
$$(Q)cp $$< $$@
4738

4839
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME_$(2)): \
4940
rt/$(2)/stage$(1)/$(CFG_RUNTIME_$(2)) \
50-
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
51-
$(SNAPSHOT_RUSTC_POST_CLEANUP)
41+
| $$(TLIB$(1)_T_$(2)_H_$(3))/
5242
@$$(call E, cp: $$@)
5343
$$(Q)cp $$< $$@
5444

@@ -87,8 +77,7 @@ ifneq ($$(findstring $(2),$$(CFG_HOST_TRIPLES)),)
8777

8878
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(3)): \
8979
rustllvm/$(2)/$(CFG_RUSTLLVM_$(3)) \
90-
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
91-
$(SNAPSHOT_RUSTC_POST_CLEANUP)
80+
| $$(TLIB$(1)_T_$(2)_H_$(3))/
9281
@$$(call E, cp: $$@)
9382
$$(Q)cp $$< $$@
9483

branches/dist-snap/mk/tests.mk

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -476,15 +476,15 @@ RFAIL_RC := $(wildcard $(S)src/test/run-fail/*.rc)
476476
RFAIL_RS := $(wildcard $(S)src/test/run-fail/*.rs)
477477
CFAIL_RC := $(wildcard $(S)src/test/compile-fail/*.rc)
478478
CFAIL_RS := $(wildcard $(S)src/test/compile-fail/*.rs)
479-
BENCH_RS := $(wildcard $(S)src/test/bench/*.rs)
479+
BENCH_RS := $(wildcard $(S)src/test/bench/rt/*.rs $(S)src/test/bench/shootout/*.rs $(S)src/test/bench/std/*.rs $(S)src/test/bench/*.rs)
480480
PRETTY_RS := $(wildcard $(S)src/test/pretty/*.rs)
481481
DEBUGINFO_RS := $(wildcard $(S)src/test/debug-info/*.rs)
482482
CODEGEN_RS := $(wildcard $(S)src/test/codegen/*.rs)
483483
CODEGEN_CC := $(wildcard $(S)src/test/codegen/*.cc)
484484

485485
# perf tests are the same as bench tests only they run under
486486
# a performance monitor.
487-
PERF_RS := $(wildcard $(S)src/test/bench/*.rs)
487+
PERF_RS := $(BENCH_RS)
488488

489489
RPASS_TESTS := $(RPASS_RC) $(RPASS_RS)
490490
RPASS_FULL_TESTS := $(RPASS_FULL_RC) $(RPASS_FULL_RS)
@@ -516,7 +516,7 @@ CTEST_BUILD_BASE_cfail = compile-fail
516516
CTEST_MODE_cfail = compile-fail
517517
CTEST_RUNTOOL_cfail = $(CTEST_RUNTOOL)
518518

519-
CTEST_SRC_BASE_bench = bench
519+
CTEST_SRC_BASE_bench = bench bench/rt bench/shootout bench/std
520520
CTEST_BUILD_BASE_bench = bench
521521
CTEST_MODE_bench = run-pass
522522
CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
@@ -610,7 +610,8 @@ define DEF_RUN_COMPILETEST
610610

611611
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
612612
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
613-
--src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
613+
$(foreach base,$$(CTEST_SRC_BASE_$(4)), \
614+
--src-base $$(S)src/test/$$(base))/ \
614615
--build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
615616
--ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
616617
--mode $$(CTEST_MODE_$(4)) \

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub struct config {
3636
llvm_bin_path: Option<Path>,
3737

3838
// The directory containing the tests to run
39-
src_base: Path,
39+
src_base: ~[Path],
4040

4141
// The directory where programs should be built
4242
build_base: Path,

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

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::os;
1919
use std::f64;
2020

2121
use extra::getopts;
22-
use extra::getopts::groups::{optopt, optflag, reqopt};
22+
use extra::getopts::groups::{optopt, optflag, reqopt, optmulti};
2323
use extra::test;
2424

2525
use common::config;
@@ -49,19 +49,19 @@ pub fn main() {
4949
pub fn parse_config(args: ~[~str]) -> config {
5050

5151
let groups : ~[getopts::groups::OptGroup] =
52-
~[reqopt("", "compile-lib-path", "path to host shared libraries", "PATH"),
53-
reqopt("", "run-lib-path", "path to target shared libraries", "PATH"),
54-
reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH"),
55-
optopt("", "clang-path", "path to executable for codegen tests", "PATH"),
56-
optopt("", "llvm-bin-path", "path to directory holding llvm binaries", "DIR"),
57-
reqopt("", "src-base", "directory to scan for test files", "PATH"),
58-
reqopt("", "build-base", "directory to deposit test outputs", "PATH"),
59-
reqopt("", "aux-base", "directory to find auxiliary test files", "PATH"),
60-
reqopt("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
61-
reqopt("", "mode", "which sort of compile tests to run",
62-
"(compile-fail|run-fail|run-pass|pretty|debug-info)"),
63-
optflag("", "ignored", "run tests marked as ignored / xfailed"),
64-
optopt("", "runtool", "supervisor program to run tests under \
52+
~[reqopt ("", "compile-lib-path", "path to host shared libraries", "PATH"),
53+
reqopt ("", "run-lib-path", "path to target shared libraries", "PATH"),
54+
reqopt ("", "rustc-path", "path to rustc to use for compiling", "PATH"),
55+
optopt ("", "clang-path", "path to executable for codegen tests", "PATH"),
56+
optopt ("", "llvm-bin-path", "path to directory holding llvm binaries", "DIR"),
57+
optmulti ("", "src-base", "directory to scan for test files", "PATH"),
58+
reqopt ("", "build-base", "directory to deposit test outputs", "PATH"),
59+
reqopt ("", "aux-base", "directory to find auxiliary test files", "PATH"),
60+
reqopt ("", "stage-id", "the target-stage identifier", "stageN-TARGET"),
61+
reqopt ("", "mode", "which sort of compile tests to run",
62+
" (compile-fail|run-fail|run-pass|pretty|debug-info)"),
63+
optflag ("", "ignored", "run tests marked as ignored / xfailed"),
64+
optopt ("", "runtool", "supervisor program to run tests under \
6565
(eg. emulator, valgrind)", "PROGRAM"),
6666
optopt("", "rustcflags", "flags to pass to rustc", "FLAGS"),
6767
optflag("", "verbose", "run tests verbosely, showing all output"),
@@ -105,13 +105,15 @@ pub fn parse_config(args: ~[~str]) -> config {
105105
Path(getopts::opt_str(m, nm))
106106
}
107107

108+
let src_base = getopts::opt_strs(matches, "src-base");
109+
108110
config {
109111
compile_lib_path: getopts::opt_str(matches, "compile-lib-path"),
110112
run_lib_path: getopts::opt_str(matches, "run-lib-path"),
111113
rustc_path: opt_path(matches, "rustc-path"),
112114
clang_path: getopts::opt_maybe_str(matches, "clang-path").map_move(|s| Path(s)),
113115
llvm_bin_path: getopts::opt_maybe_str(matches, "llvm-bin-path").map_move(|s| Path(s)),
114-
src_base: opt_path(matches, "src-base"),
116+
src_base: src_base.iter().map(|x| Path(x.clone())).collect(),
115117
build_base: opt_path(matches, "build-base"),
116118
aux_base: opt_path(matches, "aux-base"),
117119
stage_id: getopts::opt_str(matches, "stage-id"),
@@ -245,7 +247,7 @@ pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
245247
debug!("making tests from %s",
246248
config.src_base.to_str());
247249
let mut tests = ~[];
248-
let dirs = os::list_dir_path(&config.src_base);
250+
let dirs = config.src_base.iter().flat_map(|x| os::list_dir_path(x).move_iter()).to_owned_vec();
249251
for file in dirs.iter() {
250252
let file = file.clone();
251253
debug!("inspecting file %s", file.to_str());

branches/dist-snap/src/etc/emacs/rust-mode.el

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
;; Url: https://github.com/mozilla/rust
66

77
(eval-when-compile (require 'cl))
8-
(eval-when-compile (require 'misc))
98

109
;; Syntax definitions and helpers
1110
(defvar rust-mode-syntax-table
@@ -58,39 +57,19 @@
5857
;; A closing brace is 1 level unindended
5958
((looking-at "}") (* rust-indent-offset (- level 1)))
6059

61-
; Doc comments in /** style with leading * indent to line up the *s
62-
((and (nth 4 (syntax-ppss)) (looking-at "*"))
63-
(+ 1 (* rust-indent-offset level)))
64-
6560
;; If we're in any other token-tree / sexp, then:
6661
;; - [ or ( means line up with the opening token
6762
;; - { means indent to either nesting-level * rust-indent-offset,
6863
;; or one further indent from that if either current line
6964
;; begins with 'else', or previous line didn't end in
70-
;; semi, comma or brace (other than whitespace and line
71-
;; comments) , and wasn't an attribute. But if we have
72-
;; something after the open brace and ending with a comma,
73-
;; treat it as fields and align them. PHEW.
65+
;; semi, comma or brace, and wasn't an attribute. PHEW.
7466
((> level 0)
7567
(let ((pt (point)))
7668
(rust-rewind-irrelevant)
7769
(backward-up-list)
78-
(cond
79-
((and
80-
(looking-at "[[(]")
81-
; We don't want to indent out to the open bracket if the
82-
; open bracket ends the line
83-
(save-excursion
84-
(forward-char)
85-
(not (looking-at "[[:space:]]*\\(?://.*\\)?$"))))
86-
(+ 1 (current-column)))
87-
;; Check for fields on the same line as the open curly brace:
88-
((looking-at "{[[:blank:]]*[^}\n]*,[[:space:]]*$")
70+
(if (looking-at "[[(]")
71+
(+ 1 (current-column))
8972
(progn
90-
(forward-char)
91-
(forward-to-word 1)
92-
(current-column)))
93-
(t (progn
9473
(goto-char pt)
9574
(back-to-indentation)
9675
(if (looking-at "\\<else\\>")
@@ -100,12 +79,12 @@
10079
(beginning-of-line)
10180
(rust-rewind-irrelevant)
10281
(end-of-line)
103-
(if (looking-back "[,;{}(][[:space:]]*\\(?://.*\\)?")
82+
(if (looking-back "[{};,]")
10483
(* rust-indent-offset level)
10584
(back-to-indentation)
10685
(if (looking-at "#")
10786
(* rust-indent-offset level)
108-
(* rust-indent-offset (+ 1 level)))))))))))
87+
(* rust-indent-offset (+ 1 level))))))))))
10988

11089
;; Otherwise we're in a column-zero definition
11190
(t 0))))))

0 commit comments

Comments
 (0)