Skip to content

Commit 7076f20

Browse files
committed
---
yaml --- r: 134125 b: refs/heads/master c: 7fbbfe6 h: refs/heads/master i: 134123: 4522bf6 v: v3
1 parent a3b13a3 commit 7076f20

File tree

279 files changed

+4490
-2565
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

+4490
-2565
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: c942df9fa590d53a87a1c47aba5938c7f7d100b6
2+
refs/heads/master: 7fbbfe6bf29b984275c9bc59754e8ec053838781
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 437179ed8bf7f7672f84b19265df1ce569e70490
55
refs/heads/try: 777654cfccbfa39bc7f671d8e9629018ed8ca12d

trunk/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.

trunk/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)

trunk/mk/tests.mk

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,6 @@ 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-
200197
# Some less critical tests that are not prone to breakage.
201198
# Not run as part of the normal test suite, but tested by bors on checkin.
202199
check-secondary: check-lexer check-pretty

trunk/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
}

trunk/src/compiletest/runtest.rs

Lines changed: 58 additions & 41 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(),
@@ -834,24 +849,15 @@ fn check_debugger_output(debugger_run_result: &ProcRes, check_lines: &[String])
834849

835850
fn check_error_patterns(props: &TestProps,
836851
testfile: &Path,
852+
output_to_check: &str,
837853
proc_res: &ProcRes) {
838854
if props.error_patterns.is_empty() {
839855
fatal(format!("no error pattern specified in {}",
840856
testfile.display()).as_slice());
841857
}
842-
843-
if proc_res.status.success() {
844-
fatal("process did not return an error status");
845-
}
846-
847858
let mut next_err_idx = 0u;
848859
let mut next_err_pat = &props.error_patterns[next_err_idx];
849860
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-
};
855861
for line in output_to_check.as_slice().lines() {
856862
if line.contains(next_err_pat.as_slice()) {
857863
debug!("found error pattern {}", next_err_pat);
@@ -890,6 +896,16 @@ fn check_no_compiler_crash(proc_res: &ProcRes) {
890896
}
891897
}
892898

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+
893909
fn check_expected_errors(expected_errors: Vec<errors::ExpectedError> ,
894910
testfile: &Path,
895911
proc_res: &ProcRes) {
@@ -1079,11 +1095,12 @@ fn compile_test_(config: &Config, props: &TestProps,
10791095
testfile: &Path, extra_args: &[String]) -> ProcRes {
10801096
let aux_dir = aux_output_dir_name(config, testfile);
10811097
// 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());
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()));
10841101
let args = make_compile_args(config,
10851102
props,
1086-
link_args.append(extra_args),
1103+
link_args,
10871104
|a, b| ThisFile(make_exe_name(a, b)), testfile);
10881105
compose_and_run_compiler(config, props, testfile, args, None)
10891106
}
@@ -1130,16 +1147,16 @@ fn compose_and_run_compiler(
11301147
for rel_ab in props.aux_builds.iter() {
11311148
let abs_ab = config.aux_base.join(rel_ab.as_slice());
11321149
let aux_props = header::load_props(&abs_ab);
1133-
let crate_type = if aux_props.no_prefer_dynamic {
1150+
let mut crate_type = if aux_props.no_prefer_dynamic {
11341151
Vec::new()
11351152
} else {
11361153
vec!("--crate-type=dylib".to_string())
11371154
};
1155+
crate_type.extend(extra_link_args.clone().into_iter());
11381156
let aux_args =
11391157
make_compile_args(config,
11401158
&aux_props,
1141-
crate_type.append(
1142-
extra_link_args.as_slice()),
1159+
crate_type,
11431160
|a,b| {
11441161
let f = make_lib_name(a, b, testfile);
11451162
ThisDirectory(f.dir_path())
@@ -1230,11 +1247,11 @@ fn make_compile_args(config: &Config,
12301247
};
12311248
args.push(path.as_str().unwrap().to_string());
12321249
if props.force_host {
1233-
args.push_all_move(split_maybe_args(&config.host_rustcflags));
1250+
args.extend(split_maybe_args(&config.host_rustcflags).into_iter());
12341251
} else {
1235-
args.push_all_move(split_maybe_args(&config.target_rustcflags));
1252+
args.extend(split_maybe_args(&config.target_rustcflags).into_iter());
12361253
}
1237-
args.push_all_move(split_maybe_args(&props.compile_flags));
1254+
args.extend(split_maybe_args(&props.compile_flags).into_iter());
12381255
return ProcArgs {
12391256
prog: config.rustc_path.as_str().unwrap().to_string(),
12401257
args: args,
@@ -1251,10 +1268,9 @@ fn make_lib_name(config: &Config, auxfile: &Path, testfile: &Path) -> Path {
12511268
fn make_exe_name(config: &Config, testfile: &Path) -> Path {
12521269
let mut f = output_base_name(config, testfile);
12531270
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-
}
1271+
let mut fname = f.filename().unwrap().to_vec();
1272+
fname.extend(os::consts::EXE_SUFFIX.bytes());
1273+
f.set_filename(fname);
12581274
}
12591275
f
12601276
}
@@ -1270,7 +1286,7 @@ fn make_run_args(config: &Config, props: &TestProps, testfile: &Path) ->
12701286
args.push(exe_file.as_str().unwrap().to_string());
12711287

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

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

13671383
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
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)
13741388
}
13751389

13761390
fn output_testname(testfile: &Path) -> Path {
@@ -1582,22 +1596,25 @@ fn append_suffix_to_stem(p: &Path, suffix: &str) -> Path {
15821596
if suffix.len() == 0 {
15831597
(*p).clone()
15841598
} else {
1585-
let stem = p.filestem().unwrap();
1586-
p.with_filename(Vec::from_slice(stem).append(b"-").append(suffix.as_bytes()))
1599+
let mut stem = p.filestem().unwrap().to_vec();
1600+
stem.extend("-".bytes());
1601+
stem.extend(suffix.bytes());
1602+
p.with_filename(stem)
15871603
}
15881604
}
15891605

15901606
fn compile_test_and_save_bitcode(config: &Config, props: &TestProps,
15911607
testfile: &Path) -> ProcRes {
15921608
let aux_dir = aux_output_dir_name(config, testfile);
15931609
// 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());
1610+
let mut link_args = vec!("-L".to_string(),
1611+
aux_dir.as_str().unwrap().to_string());
15961612
let llvm_args = vec!("--emit=bc,obj".to_string(),
15971613
"--crate-type=lib".to_string());
1614+
link_args.extend(llvm_args.into_iter());
15981615
let args = make_compile_args(config,
15991616
props,
1600-
link_args.append(llvm_args.as_slice()),
1617+
link_args,
16011618
|a, b| ThisDirectory(output_base_name(a, b).dir_path()),
16021619
testfile);
16031620
compose_and_run_compiler(config, props, testfile, args, None)

trunk/src/doc/guide.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,8 +1575,6 @@ 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-
15801578
fn main() {
15811579
println!("Type something!");
15821580

trunk/src/doc/intro.md

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

trunk/src/doc/rust.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,8 +3833,9 @@ 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 rest: Vec<B> = map(f, xs.slice(1, xs.len()));
3837-
return vec![first].append(rest.as_slice());
3836+
let mut rest: Vec<B> = map(f, xs.slice(1, xs.len()));
3837+
rest.insert(0, first);
3838+
return rest;
38383839
}
38393840
~~~~
38403841

trunk/src/etc/make-win-dist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ def make_win_dist(dist_root, target_triple):
5858
for src in rustc_dlls:
5959
shutil.copy(src, dist_bin_dir)
6060

61-
# Copy platform tools (and another copy of runtime dlls) to platform-spcific bin directory
62-
target_bin_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "bin")
61+
# Copy platform tools to platform-specific bin directory
62+
target_bin_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "gcc", "bin")
6363
if not os.path.exists(target_bin_dir):
6464
os.makedirs(target_bin_dir)
6565
for src in target_tools:
6666
shutil.copy(src, target_bin_dir)
6767

6868
# Copy platform libs to platform-spcific lib directory
69-
target_lib_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "lib")
69+
target_lib_dir = os.path.join(dist_root, "bin", "rustlib", target_triple, "gcc", "lib")
7070
if not os.path.exists(target_lib_dir):
7171
os.makedirs(target_lib_dir)
7272
for src in target_libs:

0 commit comments

Comments
 (0)