Skip to content

Commit efffd4f

Browse files
committed
---
yaml --- r: 144619 b: refs/heads/try2 c: 7c5398b h: refs/heads/master i: 144617: c52d0b8 144615: 84bbcf9 v: v3
1 parent 0a19f08 commit efffd4f

File tree

234 files changed

+4303
-2461
lines changed

Some content is hidden

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

234 files changed

+4303
-2461
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: a3d18bc95b1639cf3cb967165f7104e2c79893f5
8+
refs/heads/try2: 7c5398b61255b557185443e9f51c4bea6a188a75
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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
212+
if impl in
213213
let loop
214214
match mod mut
215215
priv pub

branches/try2/mk/stage0.mk

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

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

branches/try2/mk/target.mk

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,28 @@ 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.
3038

3139
define TARGET_STAGE_N
3240

3341
$$(TLIB$(1)_T_$(2)_H_$(3))/libmorestack.a: \
3442
rt/$(2)/stage$(1)/arch/$$(HOST_$(2))/libmorestack.a \
35-
| $$(TLIB$(1)_T_$(2)_H_$(3))/
43+
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
44+
$(SNAPSHOT_RUSTC_POST_CLEANUP)
3645
@$$(call E, cp: $$@)
3746
$$(Q)cp $$< $$@
3847

3948
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUNTIME_$(2)): \
4049
rt/$(2)/stage$(1)/$(CFG_RUNTIME_$(2)) \
41-
| $$(TLIB$(1)_T_$(2)_H_$(3))/
50+
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
51+
$(SNAPSHOT_RUSTC_POST_CLEANUP)
4252
@$$(call E, cp: $$@)
4353
$$(Q)cp $$< $$@
4454

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

7888
$$(TLIB$(1)_T_$(2)_H_$(3))/$(CFG_RUSTLLVM_$(3)): \
7989
rustllvm/$(2)/$(CFG_RUSTLLVM_$(3)) \
80-
| $$(TLIB$(1)_T_$(2)_H_$(3))/
90+
| $$(TLIB$(1)_T_$(2)_H_$(3))/ \
91+
$(SNAPSHOT_RUSTC_POST_CLEANUP)
8192
@$$(call E, cp: $$@)
8293
$$(Q)cp $$< $$@
8394

branches/try2/mk/tests.mk

Lines changed: 6 additions & 6 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/rt/*.rs $(S)src/test/bench/shootout/*.rs $(S)src/test/bench/std/*.rs $(S)src/test/bench/*.rs)
479+
BENCH_RS := $(wildcard $(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 := $(BENCH_RS)
487+
PERF_RS := $(wildcard $(S)src/test/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 bench/rt bench/shootout bench/std
519+
CTEST_SRC_BASE_bench = bench
520520
CTEST_BUILD_BASE_bench = bench
521521
CTEST_MODE_bench = run-pass
522522
CTEST_RUNTOOL_bench = $(CTEST_RUNTOOL)
@@ -610,8 +610,7 @@ define DEF_RUN_COMPILETEST
610610

611611
CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4) := \
612612
$$(CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3)) \
613-
$(foreach base,$$(CTEST_SRC_BASE_$(4)), \
614-
--src-base $$(S)src/test/$$(base))/ \
613+
--src-base $$(S)src/test/$$(CTEST_SRC_BASE_$(4))/ \
615614
--build-base $(3)/test/$$(CTEST_BUILD_BASE_$(4))/ \
616615
--ratchet-metrics $(call TEST_RATCHET_FILE,$(1),$(2),$(3),$(4)) \
617616
--mode $$(CTEST_MODE_$(4)) \
@@ -870,7 +869,8 @@ $(foreach host,$(CFG_HOST_TRIPLES), \
870869
$(eval $(foreach target,$(CFG_TARGET_TRIPLES), \
871870
$(eval $(call DEF_CHECK_FAST_FOR_T_H,,$(target),$(host))))))
872871

873-
check-fast: tidy check-fast-H-$(CFG_BUILD_TRIPLE)
872+
check-fast: tidy check-fast-H-$(CFG_BUILD_TRIPLE) check-stage2-std check-stage2-extra
873+
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
874874

875875
define DEF_CHECK_FAST_FOR_H
876876

branches/try2/src/compiletest/common.rs

Lines changed: 1 addition & 4 deletions
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,
@@ -83,9 +83,6 @@ pub struct config {
8383
// Run tests using the JIT
8484
jit: bool,
8585

86-
// Run tests using the new runtime
87-
newrt: bool,
88-
8986
// Target system to be tested
9087
target: ~str,
9188

branches/try2/src/compiletest/compiletest.rs

Lines changed: 16 additions & 21 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, optmulti};
22+
use extra::getopts::groups::{optopt, optflag, reqopt};
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-
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 \
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 \
6565
(eg. emulator, valgrind)", "PROGRAM"),
6666
optopt("", "rustcflags", "flags to pass to rustc", "FLAGS"),
6767
optflag("", "verbose", "run tests verbosely, showing all output"),
@@ -71,7 +71,6 @@ pub fn parse_config(args: ~[~str]) -> config {
7171
optopt("", "ratchet-noise-percent",
7272
"percent change in metrics to consider noise", "N"),
7373
optflag("", "jit", "run tests under the JIT"),
74-
optflag("", "newrt", "run tests on the new runtime / scheduler"),
7574
optopt("", "target", "the target to build for", "TARGET"),
7675
optopt("", "adb-path", "path to the android debugger", "PATH"),
7776
optopt("", "adb-test-dir", "path to tests for the android debugger", "PATH"),
@@ -106,15 +105,13 @@ pub fn parse_config(args: ~[~str]) -> config {
106105
Path(getopts::opt_str(m, nm))
107106
}
108107

109-
let src_base = getopts::opt_strs(matches, "src-base");
110-
111108
config {
112109
compile_lib_path: getopts::opt_str(matches, "compile-lib-path"),
113110
run_lib_path: getopts::opt_str(matches, "run-lib-path"),
114111
rustc_path: opt_path(matches, "rustc-path"),
115112
clang_path: getopts::opt_maybe_str(matches, "clang-path").map_move(|s| Path(s)),
116113
llvm_bin_path: getopts::opt_maybe_str(matches, "llvm-bin-path").map_move(|s| Path(s)),
117-
src_base: src_base.iter().map(|x| Path(x.clone())).collect(),
114+
src_base: opt_path(matches, "src-base"),
118115
build_base: opt_path(matches, "build-base"),
119116
aux_base: opt_path(matches, "aux-base"),
120117
stage_id: getopts::opt_str(matches, "stage-id"),
@@ -137,7 +134,6 @@ pub fn parse_config(args: ~[~str]) -> config {
137134
runtool: getopts::opt_maybe_str(matches, "runtool"),
138135
rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
139136
jit: getopts::opt_present(matches, "jit"),
140-
newrt: getopts::opt_present(matches, "newrt"),
141137
target: opt_str2(getopts::opt_maybe_str(matches, "target")).to_str(),
142138
adb_path: opt_str2(getopts::opt_maybe_str(matches, "adb-path")).to_str(),
143139
adb_test_dir:
@@ -171,7 +167,6 @@ pub fn log_config(config: &config) {
171167
logv(c, fmt!("runtool: %s", opt_str(&config.runtool)));
172168
logv(c, fmt!("rustcflags: %s", opt_str(&config.rustcflags)));
173169
logv(c, fmt!("jit: %b", config.jit));
174-
logv(c, fmt!("newrt: %b", config.newrt));
175170
logv(c, fmt!("target: %s", config.target));
176171
logv(c, fmt!("adb_path: %s", config.adb_path));
177172
logv(c, fmt!("adb_test_dir: %s", config.adb_test_dir));
@@ -250,7 +245,7 @@ pub fn make_tests(config: &config) -> ~[test::TestDescAndFn] {
250245
debug!("making tests from %s",
251246
config.src_base.to_str());
252247
let mut tests = ~[];
253-
let dirs = config.src_base.iter().flat_map(|x| os::list_dir_path(x).move_iter()).to_owned_vec();
248+
let dirs = os::list_dir_path(&config.src_base);
254249
for file in dirs.iter() {
255250
let file = file.clone();
256251
debug!("inspecting file %s", file.to_str());

branches/try2/src/compiletest/runtest.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,15 +547,13 @@ fn compile_test_(config: &config, props: &TestProps,
547547
fn exec_compiled_test(config: &config, props: &TestProps,
548548
testfile: &Path) -> ProcRes {
549549

550-
// If testing the new runtime then set the RUST_NEWRT env var
551550
let env = props.exec_env.clone();
552-
let env = if config.newrt { env + &[(~"RUST_NEWRT", ~"1")] } else { env };
553551

554552
match config.target {
555553

556554
~"arm-linux-androideabi" => {
557555
if (config.adb_device_status) {
558-
_arm_exec_compiled_test(config, props, testfile)
556+
_arm_exec_compiled_test(config, props, testfile, env)
559557
} else {
560558
_dummy_exec_compiled_test(config, props, testfile)
561559
}
@@ -781,7 +779,7 @@ stderr:\n\
781779
}
782780

783781
fn _arm_exec_compiled_test(config: &config, props: &TestProps,
784-
testfile: &Path) -> ProcRes {
782+
testfile: &Path, env: ~[(~str, ~str)]) -> ProcRes {
785783

786784
let args = make_run_args(config, props, testfile);
787785
let cmdline = make_cmdline("", args.prog, args.args);
@@ -807,6 +805,9 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
807805

808806
// run test via adb_run_wrapper
809807
runargs.push(~"shell");
808+
for (key, val) in env.move_iter() {
809+
runargs.push(fmt!("%s=%s", key, val));
810+
}
810811
runargs.push(fmt!("%s/adb_run_wrapper.sh", config.adb_test_dir));
811812
runargs.push(fmt!("%s", config.adb_test_dir));
812813
runargs.push(fmt!("%s", prog_short));

branches/try2/src/etc/emacs/rust-mode.el

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

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

910
;; Syntax definitions and helpers
1011
(defvar rust-mode-syntax-table
@@ -57,19 +58,39 @@
5758
;; A closing brace is 1 level unindended
5859
((looking-at "}") (* rust-indent-offset (- level 1)))
5960

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+
6065
;; If we're in any other token-tree / sexp, then:
6166
;; - [ or ( means line up with the opening token
6267
;; - { means indent to either nesting-level * rust-indent-offset,
6368
;; or one further indent from that if either current line
6469
;; begins with 'else', or previous line didn't end in
65-
;; semi, comma or brace, and wasn't an attribute. PHEW.
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.
6674
((> level 0)
6775
(let ((pt (point)))
6876
(rust-rewind-irrelevant)
6977
(backward-up-list)
70-
(if (looking-at "[[(]")
71-
(+ 1 (current-column))
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:]]*$")
7289
(progn
90+
(forward-char)
91+
(forward-to-word 1)
92+
(current-column)))
93+
(t (progn
7394
(goto-char pt)
7495
(back-to-indentation)
7596
(if (looking-at "\\<else\\>")
@@ -79,12 +100,12 @@
79100
(beginning-of-line)
80101
(rust-rewind-irrelevant)
81102
(end-of-line)
82-
(if (looking-back "[{};,]")
103+
(if (looking-back "[,;{}(][[:space:]]*\\(?://.*\\)?")
83104
(* rust-indent-offset level)
84105
(back-to-indentation)
85106
(if (looking-at "#")
86107
(* rust-indent-offset level)
87-
(* rust-indent-offset (+ 1 level))))))))))
108+
(* rust-indent-offset (+ 1 level)))))))))))
88109

89110
;; Otherwise we're in a column-zero definition
90111
(t 0))))))

0 commit comments

Comments
 (0)