Skip to content

Commit a3b13a3

Browse files
committed
---
yaml --- r: 134124 b: refs/heads/master c: c942df9 h: refs/heads/master v: v3
1 parent 4522bf6 commit a3b13a3

File tree

279 files changed

+2566
-4495
lines changed

Some content is hidden

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

279 files changed

+2566
-4495
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 321785927c0514ada9989aae7849940ca86f0600
2+
refs/heads/master: c942df9fa590d53a87a1c47aba5938c7f7d100b6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 437179ed8bf7f7672f84b19265df1ce569e70490
55
refs/heads/try: 777654cfccbfa39bc7f671d8e9629018ed8ca12d

trunk/CONTRIBUTING.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@ 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-
137
## Pull request procedure
148

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

trunk/configure

Lines changed: 7 additions & 1 deletion
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=w64-mingw32
309+
CFG_OSTYPE=pc-mingw32
310310
if [ "$MSYSTEM" = MINGW64 ]
311311
then
312312
CFG_CPUTYPE=x86_64
@@ -477,6 +477,12 @@ 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+
480486
# Validate the release channel
481487
case "$CFG_RELEASE_CHANNEL" in
482488
(source | nightly | beta | stable)

trunk/mk/tests.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ check-ref: cleantestlibs cleantmptestlogs check-stage2-rpass \
194194
check-docs: cleantestlibs cleantmptestlogs check-stage2-docs
195195
$(Q)$(CFG_PYTHON) $(S)src/etc/check-summary.py tmp/*.log
196196

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

trunk/src/compiletest/header.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ 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>,
4745
}
4846

4947
// Load any test directives embedded in the file
@@ -61,7 +59,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
6159
let mut no_pretty_expanded = false;
6260
let mut pretty_mode = None;
6361
let mut pretty_compare_only = false;
64-
let mut forbid_output = Vec::new();
6562
iter_header(testfile, |ln| {
6663
match parse_error_pattern(ln) {
6764
Some(ep) => error_patterns.push(ep),
@@ -119,11 +116,6 @@ pub fn load_props(testfile: &Path) -> TestProps {
119116
None => ()
120117
};
121118

122-
match parse_forbid_output(ln) {
123-
Some(of) => forbid_output.push(of),
124-
None => (),
125-
}
126-
127119
true
128120
});
129121

@@ -140,8 +132,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
140132
no_prefer_dynamic: no_prefer_dynamic,
141133
no_pretty_expanded: no_pretty_expanded,
142134
pretty_mode: pretty_mode.unwrap_or("normal".to_string()),
143-
pretty_compare_only: pretty_compare_only,
144-
forbid_output: forbid_output,
135+
pretty_compare_only: pretty_compare_only
145136
}
146137
}
147138

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

222-
fn parse_forbid_output(line: &str) -> Option<String> {
223-
parse_name_value_directive(line, "forbid-output")
224-
}
225-
226213
fn parse_aux_build(line: &str) -> Option<String> {
227214
parse_name_value_directive(line, "aux-build")
228215
}

trunk/src/compiletest/runtest.rs

Lines changed: 41 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,6 @@ 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-
8274
fn run_cfail_test(config: &Config, props: &TestProps, testfile: &Path) {
8375
let proc_res = compile_test(config, props, testfile);
8476

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

9082
check_correct_failure_status(&proc_res);
9183

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);
9784
let expected_errors = errors::load_errors(&config.cfail_regex, testfile);
9885
if !expected_errors.is_empty() {
9986
if !props.error_patterns.is_empty() {
10087
fatal("both error pattern and expected errors specified");
10188
}
10289
check_expected_errors(expected_errors, testfile, &proc_res);
10390
} else {
104-
check_error_patterns(props, testfile, output_to_check.as_slice(), &proc_res);
91+
check_error_patterns(props, testfile, &proc_res);
10592
}
10693
check_no_compiler_crash(&proc_res);
107-
check_forbid_output(props, output_to_check.as_slice(), &proc_res);
10894
}
10995

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

129-
let output_to_check = get_output(props, &proc_res);
130115
check_correct_failure_status(&proc_res);
131-
check_error_patterns(props, testfile, output_to_check.as_slice(), &proc_res);
116+
check_error_patterns(props, testfile, &proc_res);
132117
}
133118

134119
fn check_correct_failure_status(proc_res: &ProcRes) {
@@ -273,8 +258,8 @@ fn run_pretty_test(config: &Config, props: &TestProps, testfile: &Path) {
273258
format!("--target={}", config.target),
274259
"-L".to_string(),
275260
aux_dir.as_str().unwrap().to_string());
276-
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
277-
args.extend(split_maybe_args(&props.compile_flags).into_iter());
261+
args.push_all_move(split_maybe_args(&config.target_rustcflags));
262+
args.push_all_move(split_maybe_args(&props.compile_flags));
278263
return ProcArgs {
279264
prog: config.rustc_path.as_str().unwrap().to_string(),
280265
args: args,
@@ -321,8 +306,8 @@ actual:\n\
321306
config.build_base.as_str().unwrap().to_string(),
322307
"-L".to_string(),
323308
aux_dir.as_str().unwrap().to_string());
324-
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
325-
args.extend(split_maybe_args(&props.compile_flags).into_iter());
309+
args.push_all_move(split_maybe_args(&config.target_rustcflags));
310+
args.push_all_move(split_maybe_args(&props.compile_flags));
326311
// FIXME (#9639): This needs to handle non-utf8 paths
327312
return ProcArgs {
328313
prog: config.rustc_path.as_str().unwrap().to_string(),
@@ -849,15 +834,24 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
849834

850835
fn check_error_patterns(props: &TestProps,
851836
testfile: &Path,
852-
output_to_check: &str,
853837
proc_res: &ProcRes) {
854838
if props.error_patterns.is_empty() {
855839
fatal(format!("no error pattern specified in {}",
856840
testfile.display()).as_slice());
857841
}
842+
843+
if proc_res.status.success() {
844+
fatal("process did not return an error status");
845+
}
846+
858847
let mut next_err_idx = 0u;
859848
let mut next_err_pat = &props.error_patterns[next_err_idx];
860849
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+
};
861855
for line in output_to_check.as_slice().lines() {
862856
if line.contains(next_err_pat.as_slice()) {
863857
debug!("found error pattern {}", next_err_pat);
@@ -896,16 +890,6 @@ fn check_no_compiler_crash(proc_res: &ProcRes) {
896890
}
897891
}
898892

899-
fn check_forbid_output(props: &TestProps,
900-
output_to_check: &str,
901-
proc_res: &ProcRes) {
902-
for pat in props.forbid_output.iter() {
903-
if output_to_check.contains(pat.as_slice()) {
904-
fatal_proc_rec("forbidden pattern found in compiler output", proc_res);
905-
}
906-
}
907-
}
908-
909893
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
910894
testfile: &Path,
911895
proc_res: &ProcRes) {
@@ -1095,12 +1079,11 @@ fn compile_test_(config: &Config, props: &TestProps,
10951079
testfile: &Path, extra_args: &[String]) -> ProcRes {
10961080
let aux_dir = aux_output_dir_name(config, testfile);
10971081
// FIXME (#9639): This needs to handle non-utf8 paths
1098-
let mut link_args = vec!("-L".to_string(),
1099-
aux_dir.as_str().unwrap().to_string());
1100-
link_args.extend(extra_args.iter().map(|s| s.clone()));
1082+
let link_args = vec!("-L".to_string(),
1083+
aux_dir.as_str().unwrap().to_string());
11011084
let args = make_compile_args(config,
11021085
props,
1103-
link_args,
1086+
link_args.append(extra_args),
11041087
|a, b| ThisFile(make_exe_name(a, b)), testfile);
11051088
compose_and_run_compiler(config, props, testfile, args, None)
11061089
}
@@ -1147,16 +1130,16 @@ fn compose_and_run_compiler(
11471130
for rel_ab in props.aux_builds.iter() {
11481131
let abs_ab = config.aux_base.join(rel_ab.as_slice());
11491132
let aux_props = header::load_props(&abs_ab);
1150-
let mut crate_type = if aux_props.no_prefer_dynamic {
1133+
let crate_type = if aux_props.no_prefer_dynamic {
11511134
Vec::new()
11521135
} else {
11531136
vec!("--crate-type=dylib".to_string())
11541137
};
1155-
crate_type.extend(extra_link_args.clone().into_iter());
11561138
let aux_args =
11571139
make_compile_args(config,
11581140
&aux_props,
1159-
crate_type,
1141+
crate_type.append(
1142+
extra_link_args.as_slice()),
11601143
|a,b| {
11611144
let f = make_lib_name(a, b, testfile);
11621145
ThisDirectory(f.dir_path())
@@ -1247,11 +1230,11 @@ fn make_compile_args(config: &Config,
12471230
};
12481231
args.push(path.as_str().unwrap().to_string());
12491232
if props.force_host {
1250-
args.extend(split_maybe_args(&config.host_rustcflags).into_iter());
1233+
args.push_all_move(split_maybe_args(&config.host_rustcflags));
12511234
} else {
1252-
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
1235+
args.push_all_move(split_maybe_args(&config.target_rustcflags));
12531236
}
1254-
args.extend(split_maybe_args(&props.compile_flags).into_iter());
1237+
args.push_all_move(split_maybe_args(&props.compile_flags));
12551238
return ProcArgs {
12561239
prog: config.rustc_path.as_str().unwrap().to_string(),
12571240
args: args,
@@ -1268,9 +1251,10 @@ fn make_lib_name(config: &Config, auxfile: &Path, testfile: &Path) -> Path {
12681251
fn make_exe_name(config: &Config, testfile: &Path) -> Path {
12691252
let mut f = output_base_name(config, testfile);
12701253
if !os::consts::EXE_SUFFIX.is_empty() {
1271-
let mut fname = f.filename().unwrap().to_vec();
1272-
fname.extend(os::consts::EXE_SUFFIX.bytes());
1273-
f.set_filename(fname);
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+
}
12741258
}
12751259
f
12761260
}
@@ -1286,7 +1270,7 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path) ->
12861270
args.push(exe_file.as_str().unwrap().to_string());
12871271

12881272
// Add the arguments in the run_flags directive
1289-
args.extend(split_maybe_args(&props.run_flags).into_iter());
1273+
args.push_all_move(split_maybe_args(&props.run_flags));
12901274

12911275
let prog = args.remove(0).unwrap();
12921276
return ProcArgs {
@@ -1381,10 +1365,12 @@ fn make_out_name(config: &Config, testfile: &Path, extension: &str) -> Path {
13811365
}
13821366

13831367
fn aux_output_dir_name(config: &Config, testfile: &Path) -> Path {
1384-
let f = output_base_name(config, testfile);
1385-
let mut fname = f.filename().unwrap().to_vec();
1386-
fname.extend("libaux".bytes());
1387-
f.with_filename(fname)
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
13881374
}
13891375

13901376
fn output_testname(testfile: &Path) -> Path {
@@ -1596,25 +1582,22 @@ fn append_suffix_to_stem(p: &Path, suffix: &str) -> Path {
15961582
if suffix.len() == 0 {
15971583
(*p).clone()
15981584
} else {
1599-
let mut stem = p.filestem().unwrap().to_vec();
1600-
stem.extend("-".bytes());
1601-
stem.extend(suffix.bytes());
1602-
p.with_filename(stem)
1585+
let stem = p.filestem().unwrap();
1586+
p.with_filename(Vec::from_slice(stem).append(b"-").append(suffix.as_bytes()))
16031587
}
16041588
}
16051589

16061590
fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
16071591
testfile: &Path) -> ProcRes {
16081592
let aux_dir = aux_output_dir_name(config, testfile);
16091593
// FIXME (#9639): This needs to handle non-utf8 paths
1610-
let mut link_args = vec!("-L".to_string(),
1611-
aux_dir.as_str().unwrap().to_string());
1594+
let link_args = vec!("-L".to_string(),
1595+
aux_dir.as_str().unwrap().to_string());
16121596
let llvm_args = vec!("--emit=bc,obj".to_string(),
16131597
"--crate-type=lib".to_string());
1614-
link_args.extend(llvm_args.into_iter());
16151598
let args = make_compile_args(config,
16161599
props,
1617-
link_args,
1600+
link_args.append(llvm_args.as_slice()),
16181601
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
16191602
testfile);
16201603
compose_and_run_compiler(config, props, testfile, args, None)

trunk/src/doc/guide.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,6 +1575,8 @@ we haven't seen before. Here's a simple program that reads some input,
15751575
and then prints it back out:
15761576

15771577
```{rust,ignore}
1578+
use std::io;
1579+
15781580
fn main() {
15791581
println!("Type something!");
15801582
@@ -2151,14 +2153,10 @@ In this case, we say `x` is a `uint` explicitly, so Rust is able to properly
21512153
tell `random()` what to generate. In a similar fashion, both of these work:
21522154

21532155
```{rust,ignore}
2154-
let input_num = from_str::<Option<uint>>("5");
2156+
let input_num = from_str::<uint>("5");
21552157
let input_num: Option<uint> = from_str("5");
21562158
```
21572159

2158-
In this case, I happen to prefer the latter, and in the `random()` case, I prefer
2159-
the former. I think the nested `<>`s make the first option especially ugly and
2160-
a bit harder to read.
2161-
21622160
Anyway, with us now converting our input to a number, our code looks like this:
21632161

21642162
```{rust,ignore}

trunk/src/doc/intro.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@ Here's some code:
300300
use std::sync::Arc;
301301
302302
fn main() {
303-
let numbers = Arc::new(vec![1i, 2i, 3i]);
303+
let numbers = vec![1i, 2i, 3i];
304+
let numbers = Arc::new(numbers);
304305
305306
for num in range(0u, 3) {
306307
let (tx, rx) = channel();
@@ -345,7 +346,8 @@ and modify it to mutate the shared state:
345346
use std::sync::{Arc, Mutex};
346347
347348
fn main() {
348-
let numbers_lock = Arc::new(Mutex::new(vec![1i, 2i, 3i]));
349+
let numbers = vec![1i, 2i, 3i];
350+
let numbers_lock = Arc::new(Mutex::new(numbers));
349351
350352
for num in range(0u, 3) {
351353
let (tx, rx) = channel();

trunk/src/doc/rust.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,9 +3833,8 @@ fn map<A: Clone, B: Clone>(f: |A| -> B, xs: &[A]) -> Vec<B> {
38333833
return vec![];
38343834
}
38353835
let first: B = f(xs[0].clone());
3836-
let mut rest: Vec<B> = map(f, xs.slice(1, xs.len()));
3837-
rest.insert(0, first);
3838-
return rest;
3836+
let rest: Vec<B> = map(f, xs.slice(1, xs.len()));
3837+
return vec![first].append(rest.as_slice());
38393838
}
38403839
~~~~
38413840

0 commit comments

Comments
 (0)