Skip to content

Commit 6ec1c2e

Browse files
committed
---
yaml --- r: 134953 b: refs/heads/snap-stage3 c: 5e13d3a h: refs/heads/master i: 134951: 870e55a v: v3
1 parent b0e542f commit 6ec1c2e

File tree

306 files changed

+9346
-7799
lines changed

Some content is hidden

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

306 files changed

+9346
-7799
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: 7eb9337dace88c5ded431aa7507f06d50619131b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: fe8a413fc0f5d7d021ec42ac1a4149db662ca92c
4+
refs/heads/snap-stage3: 5e13d3aa00e8cfdf1a64f58f6c649460400231c0
55
refs/heads/try: 14378ea357c06c23607ca61ade44f60a7a64a1c7
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ If you're just reporting a bug, please see:
44

55
http://doc.rust-lang.org/complement-bugreport.html
66

7+
## Submitting an issue
8+
9+
Please submit issues here for bug reports or implementation details. For feature
10+
requests, language changes, or major changes to the libraries, please submit an
11+
issue against the [RFCs repository](https://github.com/rust-lang/rfcs).
12+
713
## Pull request procedure
814

915
Pull requests should be targeted at Rust's `master` branch.

branches/snap-stage3/configure

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ case $CFG_OSTYPE in
306306
# instead, msys defines $MSYSTEM which is MINGW32 on i686 and
307307
# MINGW64 on x86_64.
308308
CFG_CPUTYPE=i686
309-
CFG_OSTYPE=pc-mingw32
309+
CFG_OSTYPE=w64-mingw32
310310
if [ "$MSYSTEM" = MINGW64 ]
311311
then
312312
CFG_CPUTYPE=x86_64
@@ -477,12 +477,6 @@ fi
477477
step_msg "validating $CFG_SELF args"
478478
validate_opt
479479

480-
# Temporarily support the old windows triples while the bots make the transition
481-
# XXX Remove me
482-
CFG_BUILD=`echo "${CFG_BUILD}" | sed 's/-pc-mingw32/-w64-mingw32/g'`
483-
CFG_HOST=`echo "${CFG_HOST}" | sed 's/-pc-mingw32/-w64-mingw32/g'`
484-
CFG_TARGET=`echo "${CFG_TARGET}" | sed 's/-pc-mingw32/-w64-mingw32/g'`
485-
486480
# Validate the release channel
487481
case "$CFG_RELEASE_CHANNEL" in
488482
(source | nightly | beta | stable)

branches/snap-stage3/mk/docs.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
2929
guide-tasks guide-container guide-pointers guide-testing \
3030
guide-runtime complement-bugreport \
3131
complement-lang-faq complement-design-faq complement-project-faq rust \
32-
rustdoc guide-unsafe guide-strings
32+
rustdoc guide-unsafe guide-strings reference
3333

34-
PDF_DOCS := guide rust
34+
PDF_DOCS := guide reference
3535

3636
RUSTDOC_DEPS_rust := doc/full-toc.inc
3737
RUSTDOC_FLAGS_rust := --html-in-header=doc/full-toc.inc

branches/snap-stage3/mk/rt.mk

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,9 @@ LIBUV_CFLAGS_$(1) := $(subst -Werror,,$(CFG_GCCISH_CFLAGS_$(1)))
203203

204204
$$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
205205
(cd $(S)src/libuv/ && \
206+
CC="$$(CC_$(1))" \
207+
CXX="$$(CXX_$(1))" \
208+
AR="$$(AR_$(1))" \
206209
$$(CFG_PYTHON) ./gyp_uv.py -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) \
207210
-D ninja \
208211
-DOS=$$(LIBUV_OSTYPE_$(1)) \
@@ -225,6 +228,9 @@ else ifeq ($(OSTYPE_$(1)), apple-ios) # iOS
225228
$$(LIBUV_XCODEPROJ_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
226229
cp -rf $(S)src/libuv/ $$(LIBUV_BUILD_DIR_$(1))
227230
(cd $$(LIBUV_BUILD_DIR_$(1)) && \
231+
CC="$$(CC_$(1))" \
232+
CXX="$$(CXX_$(1))" \
233+
AR="$$(AR_$(1))" \
228234
$$(CFG_PYTHON) ./gyp_uv.py -f xcode \
229235
-D ninja \
230236
-R libuv)

branches/snap-stage3/mk/tests.mk

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,14 @@ ifdef VERBOSE
6060
CTEST_TESTARGS += --verbose
6161
endif
6262

63+
# Setting locale ensures that gdb's output remains consistent.
64+
# This prevents tests from failing with some locales (fixes #17423).
65+
export LC_ALL=C
66+
6367
# If we're running perf then set this environment variable
6468
# to put the benchmarks into 'hard mode'
6569
ifeq ($(MAKECMDGOALS),perf)
66-
RUST_BENCH=1
67-
export RUST_BENCH
70+
export RUST_BENCH=1
6871
endif
6972

7073
TEST_LOG_FILE=tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).log
@@ -194,9 +197,6 @@ check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass \
194197
check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
195198
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
196199

197-
# NOTE: Remove after reprogramming windows bots
198-
check-fast: check-lite
199-
200200
# Some less critical tests that are not prone to breakage.
201201
# Not run as part of the normal test suite, but tested by bors on checkin.
202202
check-secondary: check-lexer check-pretty

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

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ pub struct TestProps {
4242
pub pretty_mode: String,
4343
// Only compare pretty output and don't try compiling
4444
pub pretty_compare_only: bool,
45+
// Patterns which must not appear in the output of a cfail test.
46+
pub forbid_output: Vec<String>,
4547
}
4648

4749
// Load any test directives embedded in the file
@@ -59,6 +61,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
5961
let mut no_pretty_expanded = false;
6062
let mut pretty_mode = None;
6163
let mut pretty_compare_only = false;
64+
let mut forbid_output = Vec::new();
6265
iter_header(testfile, |ln| {
6366
match parse_error_pattern(ln) {
6467
Some(ep) => error_patterns.push(ep),
@@ -116,6 +119,11 @@ pub fn load_props(testfile: &Path) -> TestProps {
116119
None => ()
117120
};
118121

122+
match parse_forbid_output(ln) {
123+
Some(of) => forbid_output.push(of),
124+
None => (),
125+
}
126+
119127
true
120128
});
121129

@@ -132,7 +140,8 @@ pub fn load_props(testfile: &Path) -> TestProps {
132140
no_prefer_dynamic: no_prefer_dynamic,
133141
no_pretty_expanded: no_pretty_expanded,
134142
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
135-
pretty_compare_only: pretty_compare_only
143+
pretty_compare_only: pretty_compare_only,
144+
forbid_output: forbid_output,
136145
}
137146
}
138147

@@ -210,6 +219,10 @@ fn parse_error_pattern(line: &str) -> Option<String> {
210219
parse_name_value_directive(line, "error-pattern")
211220
}
212221

222+
fn parse_forbid_output(line: &str) -> Option<String> {
223+
parse_name_value_directive(line, "forbid-output")
224+
}
225+
213226
fn parse_aux_build(line: &str) -> Option<String> {
214227
parse_name_value_directive(line, "aux-build")
215228
}

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

Lines changed: 60 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ pub fn run_metrics(config: Config, testfile: String, mm: &mut MetricMap) {
7171
}
7272
}
7373

74+
fn get_output(props: &TestProps, proc_res: &ProcRes) -> String {
75+
if props.check_stdout {
76+
format!("{}{}", proc_res.stdout, proc_res.stderr)
77+
} else {
78+
proc_res.stderr.clone()
79+
}
80+
}
81+
7482
fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
7583
let proc_res = compile_test(config, props, testfile);
7684

@@ -81,16 +89,22 @@ fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
8189

8290
check_correct_failure_status(&proc_res);
8391

92+
if proc_res.status.success() {
93+
fatal("process did not return an error status");
94+
}
95+
96+
let output_to_check = get_output(props, &proc_res);
8497
let expected_errors = errors::load_errors(&config.cfail_regex, testfile);
8598
if !expected_errors.is_empty() {
8699
if !props.error_patterns.is_empty() {
87100
fatal("both error pattern and expected errors specified");
88101
}
89102
check_expected_errors(expected_errors, testfile, &proc_res);
90103
} else {
91-
check_error_patterns(props, testfile, &proc_res);
104+
check_error_patterns(props, testfile, output_to_check.as_slice(), &proc_res);
92105
}
93106
check_no_compiler_crash(&proc_res);
107+
check_forbid_output(props, output_to_check.as_slice(), &proc_res);
94108
}
95109

96110
fn run_rfail_test(config: &Config, props: &TestProps, testfile: &Path) {
@@ -112,8 +126,9 @@ fn run_rfail_test(config: &Config, props: &TestProps, testfile: &Path) {
112126
fatal_proc_rec("run-fail test isn't valgrind-clean!", &proc_res);
113127
}
114128

129+
let output_to_check = get_output(props, &proc_res);
115130
check_correct_failure_status(&proc_res);
116-
check_error_patterns(props, testfile, &proc_res);
131+
check_error_patterns(props, testfile, output_to_check.as_slice(), &proc_res);
117132
}
118133

119134
fn check_correct_failure_status(proc_res: &ProcRes) {
@@ -258,8 +273,8 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
258273
format!("--target={}", config.target),
259274
"-L".to_string(),
260275
aux_dir.as_str().unwrap().to_string());
261-
args.push_all_move(split_maybe_args(&config.target_rustcflags));
262-
args.push_all_move(split_maybe_args(&props.compile_flags));
276+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
277+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
263278
return ProcArgs {
264279
prog: config.rustc_path.as_str().unwrap().to_string(),
265280
args: args,
@@ -306,8 +321,8 @@ actual:\n\
306321
config.build_base.as_str().unwrap().to_string(),
307322
"-L".to_string(),
308323
aux_dir.as_str().unwrap().to_string());
309-
args.push_all_move(split_maybe_args(&config.target_rustcflags));
310-
args.push_all_move(split_maybe_args(&props.compile_flags));
324+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
325+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
311326
// FIXME (#9639): This needs to handle non-utf8 paths
312327
return ProcArgs {
313328
prog: config.rustc_path.as_str().unwrap().to_string(),
@@ -429,7 +444,8 @@ fn run_debuginfo_gdb_test(config: &Config, props: &TestProps, testfile: &Path) {
429444
"-nx".to_string(),
430445
format!("-command={}", debugger_script.as_str().unwrap()));
431446

432-
let gdb_path = tool_path.append("/bin/arm-linux-androideabi-gdb");
447+
let mut gdb_path = tool_path;
448+
gdb_path.push_str("/bin/arm-linux-androideabi-gdb");
433449
let procsrv::Result {
434450
out,
435451
err,
@@ -834,24 +850,15 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
834850

835851
fn check_error_patterns(props: &TestProps,
836852
testfile: &Path,
853+
output_to_check: &str,
837854
proc_res: &ProcRes) {
838855
if props.error_patterns.is_empty() {
839856
fatal(format!("no error pattern specified in {}",
840857
testfile.display()).as_slice());
841858
}
842-
843-
if proc_res.status.success() {
844-
fatal("process did not return an error status");
845-
}
846-
847859
let mut next_err_idx = 0u;
848860
let mut next_err_pat = &props.error_patterns[next_err_idx];
849861
let mut done = false;
850-
let output_to_check = if props.check_stdout {
851-
format!("{}{}", proc_res.stdout, proc_res.stderr)
852-
} else {
853-
proc_res.stderr.clone()
854-
};
855862
for line in output_to_check.as_slice().lines() {
856863
if line.contains(next_err_pat.as_slice()) {
857864
debug!("found error pattern {}", next_err_pat);
@@ -890,6 +897,16 @@ fn check_no_compiler_crash(proc_res: &ProcRes) {
890897
}
891898
}
892899

900+
fn check_forbid_output(props: &TestProps,
901+
output_to_check: &str,
902+
proc_res: &ProcRes) {
903+
for pat in props.forbid_output.iter() {
904+
if output_to_check.contains(pat.as_slice()) {
905+
fatal_proc_rec("forbidden pattern found in compiler output", proc_res);
906+
}
907+
}
908+
}
909+
893910
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
894911
testfile: &Path,
895912
proc_res: &ProcRes) {
@@ -1079,11 +1096,12 @@ fn compile_test_(config: &Config, props: &TestProps,
10791096
testfile: &Path, extra_args: &[String]) -> ProcRes {
10801097
let aux_dir = aux_output_dir_name(config, testfile);
10811098
// FIXME (#9639): This needs to handle non-utf8 paths
1082-
let link_args = vec!("-L".to_string(),
1083-
aux_dir.as_str().unwrap().to_string());
1099+
let mut link_args = vec!("-L".to_string(),
1100+
aux_dir.as_str().unwrap().to_string());
1101+
link_args.extend(extra_args.iter().map(|s| s.clone()));
10841102
let args = make_compile_args(config,
10851103
props,
1086-
link_args.append(extra_args),
1104+
link_args,
10871105
|a, b| ThisFile(make_exe_name(a, b)), testfile);
10881106
compose_and_run_compiler(config, props, testfile, args, None)
10891107
}
@@ -1130,16 +1148,16 @@ fn compose_and_run_compiler(
11301148
for rel_ab in props.aux_builds.iter() {
11311149
let abs_ab = config.aux_base.join(rel_ab.as_slice());
11321150
let aux_props = header::load_props(&abs_ab);
1133-
let crate_type = if aux_props.no_prefer_dynamic {
1151+
let mut crate_type = if aux_props.no_prefer_dynamic {
11341152
Vec::new()
11351153
} else {
11361154
vec!("--crate-type=dylib".to_string())
11371155
};
1156+
crate_type.extend(extra_link_args.clone().into_iter());
11381157
let aux_args =
11391158
make_compile_args(config,
11401159
&aux_props,
1141-
crate_type.append(
1142-
extra_link_args.as_slice()),
1160+
crate_type,
11431161
|a,b| {
11441162
let f = make_lib_name(a, b, testfile);
11451163
ThisDirectory(f.dir_path())
@@ -1230,11 +1248,11 @@ fn make_compile_args(config: &Config,
12301248
};
12311249
args.push(path.as_str().unwrap().to_string());
12321250
if props.force_host {
1233-
args.push_all_move(split_maybe_args(&config.host_rustcflags));
1251+
args.extend(split_maybe_args(&config.host_rustcflags).into_iter());
12341252
} else {
1235-
args.push_all_move(split_maybe_args(&config.target_rustcflags));
1253+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
12361254
}
1237-
args.push_all_move(split_maybe_args(&props.compile_flags));
1255+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
12381256
return ProcArgs {
12391257
prog: config.rustc_path.as_str().unwrap().to_string(),
12401258
args: args,
@@ -1251,10 +1269,9 @@ fn make_lib_name(config: &Config, auxfile: &Path, testfile: &Path) -> Path {
12511269
fn make_exe_name(config: &Config, testfile: &Path) -> Path {
12521270
let mut f = output_base_name(config, testfile);
12531271
if !os::consts::EXE_SUFFIX.is_empty() {
1254-
match f.filename().map(|s| Vec::from_slice(s).append(os::consts::EXE_SUFFIX.as_bytes())) {
1255-
Some(v) => f.set_filename(v),
1256-
None => ()
1257-
}
1272+
let mut fname = f.filename().unwrap().to_vec();
1273+
fname.extend(os::consts::EXE_SUFFIX.bytes());
1274+
f.set_filename(fname);
12581275
}
12591276
f
12601277
}
@@ -1270,7 +1287,7 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path) ->
12701287
args.push(exe_file.as_str().unwrap().to_string());
12711288

12721289
// Add the arguments in the run_flags directive
1273-
args.push_all_move(split_maybe_args(&props.run_flags));
1290+
args.extend(split_maybe_args(&props.run_flags).into_iter());
12741291

12751292
let prog = args.remove(0).unwrap();
12761293
return ProcArgs {
@@ -1365,12 +1382,10 @@ fn make_out_name(config: &Config, testfile: &Path, extension: &str) -> Path {
13651382
}
13661383

13671384
fn aux_output_dir_name(config: &Config, testfile: &Path) -> Path {
1368-
let mut f = output_base_name(config, testfile);
1369-
match f.filename().map(|s| Vec::from_slice(s).append(b".libaux")) {
1370-
Some(v) => f.set_filename(v),
1371-
None => ()
1372-
}
1373-
f
1385+
let f = output_base_name(config, testfile);
1386+
let mut fname = f.filename().unwrap().to_vec();
1387+
fname.extend("libaux".bytes());
1388+
f.with_filename(fname)
13741389
}
13751390

13761391
fn output_testname(testfile: &Path) -> Path {
@@ -1582,22 +1597,25 @@ fn append_suffix_to_stem(p: &Path, suffix: &str) -> Path {
15821597
if suffix.len() == 0 {
15831598
(*p).clone()
15841599
} else {
1585-
let stem = p.filestem().unwrap();
1586-
p.with_filename(Vec::from_slice(stem).append(b"-").append(suffix.as_bytes()))
1600+
let mut stem = p.filestem().unwrap().to_vec();
1601+
stem.extend("-".bytes());
1602+
stem.extend(suffix.bytes());
1603+
p.with_filename(stem)
15871604
}
15881605
}
15891606

15901607
fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
15911608
testfile: &Path) -> ProcRes {
15921609
let aux_dir = aux_output_dir_name(config, testfile);
15931610
// FIXME (#9639): This needs to handle non-utf8 paths
1594-
let link_args = vec!("-L".to_string(),
1595-
aux_dir.as_str().unwrap().to_string());
1611+
let mut link_args = vec!("-L".to_string(),
1612+
aux_dir.as_str().unwrap().to_string());
15961613
let llvm_args = vec!("--emit=bc,obj".to_string(),
15971614
"--crate-type=lib".to_string());
1615+
link_args.extend(llvm_args.into_iter());
15981616
let args = make_compile_args(config,
15991617
props,
1600-
link_args.append(llvm_args.as_slice()),
1618+
link_args,
16011619
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
16021620
testfile);
16031621
compose_and_run_compiler(config, props, testfile, args, None)

0 commit comments

Comments
 (0)