Skip to content

Commit d768f71

Browse files
committed
---
yaml --- r: 193495 b: refs/heads/beta c: 29938ff h: refs/heads/master i: 193493: 0b31cb1 193491: a470230 193487: e26a066 v: v3
1 parent 2d8f2b7 commit d768f71

File tree

514 files changed

+3577
-5045
lines changed

Some content is hidden

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

514 files changed

+3577
-5045
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: 7a12c038a5a27403a72274af2fa603abe157da3d
34+
refs/heads/beta: 29938fff3802243bdfe9a12860384d8eade20a7a
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/mk/docs.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,13 +273,11 @@ compiler-docs: $(COMPILER_DOC_TARGETS)
273273
trpl: doc/book/index.html
274274

275275
doc/book/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/trpl/*.md) | doc/
276-
@$(call E, rustbook: $@)
277276
$(Q)rm -rf doc/book
278277
$(Q)$(RUSTBOOK) build $(S)src/doc/trpl doc/book
279278

280279
style: doc/style/index.html
281280

282281
doc/style/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/style/*.md) | doc/
283-
@$(call E, rustbook: $@)
284282
$(Q)rm -rf doc/style
285283
$(Q)$(RUSTBOOK) build $(S)src/doc/style doc/style

branches/beta/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ TEST_SREQ$(1)_T_$(2)_H_$(3) = \
590590

591591
# The tests select when to use debug configuration on their own;
592592
# remove directive, if present, from CFG_RUSTC_FLAGS (issue #7898).
593-
CTEST_RUSTC_FLAGS := $$(subst -C debug-assertions,,$$(CFG_RUSTC_FLAGS))
593+
CTEST_RUSTC_FLAGS := $$(subst --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
594594

595595
# The tests cannot be optimized while the rest of the compiler is optimized, so
596596
# filter out the optimization (if any) from rustc and then figure out if we need

branches/beta/src/compiletest/common.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ pub use self::Mode::*;
1111

1212
use std::fmt;
1313
use std::str::FromStr;
14-
use std::path::PathBuf;
1514

1615
#[derive(Clone, Copy, PartialEq, Debug)]
1716
pub enum Mode {
@@ -69,13 +68,13 @@ pub struct Config {
6968
pub run_lib_path: String,
7069

7170
// The rustc executable
72-
pub rustc_path: PathBuf,
71+
pub rustc_path: Path,
7372

7473
// The clang executable
75-
pub clang_path: Option<PathBuf>,
74+
pub clang_path: Option<Path>,
7675

7776
// The llvm binaries path
78-
pub llvm_bin_path: Option<PathBuf>,
77+
pub llvm_bin_path: Option<Path>,
7978

8079
// The valgrind path
8180
pub valgrind_path: Option<String>,
@@ -85,13 +84,13 @@ pub struct Config {
8584
pub force_valgrind: bool,
8685

8786
// The directory containing the tests to run
88-
pub src_base: PathBuf,
87+
pub src_base: Path,
8988

9089
// The directory where programs should be built
91-
pub build_base: PathBuf,
90+
pub build_base: Path,
9291

9392
// Directory for auxiliary libraries
94-
pub aux_base: PathBuf,
93+
pub aux_base: Path,
9594

9695
// The name of the stage being built (stage1, etc)
9796
pub stage_id: String,
@@ -106,7 +105,7 @@ pub struct Config {
106105
pub filter: Option<String>,
107106

108107
// Write out a parseable log of tests that were run
109-
pub logfile: Option<PathBuf>,
108+
pub logfile: Option<Path>,
110109

111110
// A command line to prefix program execution with,
112111
// for running under valgrind
@@ -134,7 +133,7 @@ pub struct Config {
134133
pub lldb_version: Option<String>,
135134

136135
// Path to the android tools
137-
pub android_cross_path: PathBuf,
136+
pub android_cross_path: Path,
138137

139138
// Extra parameter to run adb on arm-linux-androideabi
140139
pub adb_path: String,

branches/beta/src/compiletest/compiletest.rs

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
#![feature(test)]
2222
#![feature(unicode)]
2323
#![feature(core)]
24-
#![feature(path)]
25-
#![feature(os)]
26-
#![feature(io)]
27-
#![feature(fs)]
28-
#![feature(net)]
2924

3025
#![deny(warnings)]
3126

@@ -36,9 +31,8 @@ extern crate getopts;
3631
extern crate log;
3732

3833
use std::env;
39-
use std::fs;
4034
use std::old_io;
41-
use std::path::{Path, PathBuf};
35+
use std::old_io::fs;
4236
use std::thunk::Thunk;
4337
use getopts::{optopt, optflag, reqopt};
4438
use common::Config;
@@ -120,9 +114,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
120114
panic!()
121115
}
122116

123-
fn opt_path(m: &getopts::Matches, nm: &str) -> PathBuf {
117+
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
124118
match m.opt_str(nm) {
125-
Some(s) => PathBuf::new(&s),
119+
Some(s) => Path::new(s),
126120
None => panic!("no option (=path) found for {}", nm),
127121
}
128122
}
@@ -137,18 +131,18 @@ pub fn parse_config(args: Vec<String> ) -> Config {
137131
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
138132
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
139133
rustc_path: opt_path(matches, "rustc-path"),
140-
clang_path: matches.opt_str("clang-path").map(|s| PathBuf::new(&s)),
134+
clang_path: matches.opt_str("clang-path").map(|s| Path::new(s)),
141135
valgrind_path: matches.opt_str("valgrind-path"),
142136
force_valgrind: matches.opt_present("force-valgrind"),
143-
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| PathBuf::new(&s)),
137+
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::new(s)),
144138
src_base: opt_path(matches, "src-base"),
145139
build_base: opt_path(matches, "build-base"),
146140
aux_base: opt_path(matches, "aux-base"),
147141
stage_id: matches.opt_str("stage-id").unwrap(),
148142
mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
149143
run_ignored: matches.opt_present("ignored"),
150144
filter: filter,
151-
logfile: matches.opt_str("logfile").map(|s| PathBuf::new(&s)),
145+
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
152146
runtool: matches.opt_str("runtool"),
153147
host_rustcflags: matches.opt_str("host-rustcflags"),
154148
target_rustcflags: matches.opt_str("target-rustcflags"),
@@ -282,9 +276,9 @@ pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
282276
debug!("making tests from {:?}",
283277
config.src_base.display());
284278
let mut tests = Vec::new();
285-
let dirs = fs::read_dir(&config.src_base).unwrap();
286-
for file in dirs {
287-
let file = file.unwrap().path();
279+
let dirs = fs::readdir(&config.src_base).unwrap();
280+
for file in &dirs {
281+
let file = file.clone();
288282
debug!("inspecting file {:?}", file.display());
289283
if is_test(config, &file) {
290284
let t = make_test(config, &file, || {
@@ -307,7 +301,7 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {
307301
_ => vec!(".rc".to_string(), ".rs".to_string())
308302
};
309303
let invalid_prefixes = vec!(".".to_string(), "#".to_string(), "~".to_string());
310-
let name = testfile.file_name().unwrap().to_str().unwrap();
304+
let name = testfile.filename_str().unwrap();
311305

312306
let mut valid = false;
313307

@@ -343,9 +337,9 @@ pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
343337

344338
// Try to elide redundant long paths
345339
fn shorten(path: &Path) -> String {
346-
let filename = path.file_name().unwrap().to_str();
347-
let p = path.parent().unwrap();
348-
let dir = p.file_name().unwrap().to_str();
340+
let filename = path.filename_str();
341+
let p = path.dir_path();
342+
let dir = p.filename_str();
349343
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
350344
}
351345

@@ -354,17 +348,19 @@ pub fn make_test_name(config: &Config, testfile: &Path) -> test::TestName {
354348

355349
pub fn make_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
356350
let config = (*config).clone();
357-
let testfile = testfile.to_path_buf();
351+
// FIXME (#9639): This needs to handle non-utf8 paths
352+
let testfile = testfile.as_str().unwrap().to_string();
358353
test::DynTestFn(Thunk::new(move || {
359-
runtest::run(config, &testfile)
354+
runtest::run(config, testfile)
360355
}))
361356
}
362357

363358
pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
364359
let config = (*config).clone();
365-
let testfile = testfile.to_path_buf();
360+
// FIXME (#9639): This needs to handle non-utf8 paths
361+
let testfile = testfile.as_str().unwrap().to_string();
366362
test::DynMetricFn(box move |mm: &mut test::MetricMap| {
367-
runtest::run_metrics(config, &testfile, mm)
363+
runtest::run_metrics(config, testfile, mm)
368364
})
369365
}
370366

branches/beta/src/compiletest/errors.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@
99
// except according to those terms.
1010
use self::WhichLine::*;
1111

12-
use std::fs::File;
13-
use std::io::BufReader;
14-
use std::io::prelude::*;
15-
use std::path::Path;
12+
use std::old_io::{BufferedReader, File};
1613

1714
pub struct ExpectedError {
1815
pub line: uint,
@@ -32,7 +29,7 @@ enum WhichLine { ThisLine, FollowPrevious(uint), AdjustBackward(uint) }
3229
/// //~| ERROR message two for that same line.
3330
// Load any test directives embedded in the file
3431
pub fn load_errors(testfile: &Path) -> Vec<ExpectedError> {
35-
let rdr = BufReader::new(File::open(testfile).unwrap());
32+
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
3633

3734
// `last_nonfollow_error` tracks the most recently seen
3835
// line with an error template that did not use the

branches/beta/src/compiletest/header.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
// except according to those terms.
1010

1111
use std::env;
12-
use std::fs::File;
13-
use std::io::BufReader;
14-
use std::io::prelude::*;
15-
use std::path::{Path, PathBuf};
1612

1713
use common::Config;
1814
use common;
@@ -27,7 +23,7 @@ pub struct TestProps {
2723
pub run_flags: Option<String>,
2824
// If present, the name of a file that this test should match when
2925
// pretty-printed
30-
pub pp_exact: Option<PathBuf>,
26+
pub pp_exact: Option<Path>,
3127
// Modules from aux directory that should be compiled
3228
pub aux_builds: Vec<String> ,
3329
// Environment settings to use during execution
@@ -66,7 +62,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
6662
let mut pretty_mode = None;
6763
let mut pretty_compare_only = false;
6864
let mut forbid_output = Vec::new();
69-
iter_header(testfile, &mut |ln| {
65+
iter_header(testfile, |ln| {
7066
match parse_error_pattern(ln) {
7167
Some(ep) => error_patterns.push(ep),
7268
None => ()
@@ -223,7 +219,7 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
223219
}
224220
}
225221

226-
let val = iter_header(testfile, &mut |ln| {
222+
let val = iter_header(testfile, |ln| {
227223
!parse_name_directive(ln, "ignore-test") &&
228224
!parse_name_directive(ln, &ignore_target(config)) &&
229225
!parse_name_directive(ln, &ignore_stage(config)) &&
@@ -236,8 +232,12 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
236232
!val
237233
}
238234

239-
fn iter_header(testfile: &Path, it: &mut FnMut(&str) -> bool) -> bool {
240-
let rdr = BufReader::new(File::open(testfile).unwrap());
235+
fn iter_header<F>(testfile: &Path, mut it: F) -> bool where
236+
F: FnMut(&str) -> bool,
237+
{
238+
use std::old_io::{BufferedReader, File};
239+
240+
let mut rdr = BufferedReader::new(File::open(testfile).unwrap());
241241
for ln in rdr.lines() {
242242
// Assume that any directives will be found before the first
243243
// module or function. This doesn't seem to be an optimization
@@ -322,12 +322,12 @@ fn parse_exec_env(line: &str) -> Option<(String, String)> {
322322
})
323323
}
324324

325-
fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
325+
fn parse_pp_exact(line: &str, testfile: &Path) -> Option<Path> {
326326
match parse_name_value_directive(line, "pp-exact") {
327-
Some(s) => Some(PathBuf::new(&s)),
327+
Some(s) => Some(Path::new(s)),
328328
None => {
329329
if parse_name_directive(line, "pp-exact") {
330-
testfile.file_name().map(|s| PathBuf::new(s))
330+
testfile.filename().map(|s| Path::new(s))
331331
} else {
332332
None
333333
}

branches/beta/src/compiletest/procsrv.rs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::process::{ExitStatus, Command, Child, Output, Stdio};
12-
use std::io::prelude::*;
11+
use std::old_io::process::{ProcessExit, Command, Process, ProcessOutput};
1312
use std::dynamic_lib::DynamicLibrary;
1413

1514
fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
@@ -26,10 +25,10 @@ fn add_target_env(cmd: &mut Command, lib_path: &str, aux_path: Option<&str>) {
2625
let var = DynamicLibrary::envvar();
2726
let newpath = DynamicLibrary::create_path(&path);
2827
let newpath = String::from_utf8(newpath).unwrap();
29-
cmd.env(var, &newpath);
28+
cmd.env(var.to_string(), newpath);
3029
}
3130

32-
pub struct Result {pub status: ExitStatus, pub out: String, pub err: String}
31+
pub struct Result {pub status: ProcessExit, pub out: String, pub err: String}
3332

3433
pub fn run(lib_path: &str,
3534
prog: &str,
@@ -39,27 +38,24 @@ pub fn run(lib_path: &str,
3938
input: Option<String>) -> Option<Result> {
4039

4140
let mut cmd = Command::new(prog);
42-
cmd.args(args)
43-
.stdin(Stdio::piped())
44-
.stdout(Stdio::piped())
45-
.stderr(Stdio::piped());
41+
cmd.args(args);
4642
add_target_env(&mut cmd, lib_path, aux_path);
4743
for (key, val) in env {
48-
cmd.env(&key, &val);
44+
cmd.env(key, val);
4945
}
5046

5147
match cmd.spawn() {
5248
Ok(mut process) => {
5349
if let Some(input) = input {
5450
process.stdin.as_mut().unwrap().write_all(input.as_bytes()).unwrap();
5551
}
56-
let Output { status, stdout, stderr } =
52+
let ProcessOutput { status, output, error } =
5753
process.wait_with_output().unwrap();
5854

5955
Some(Result {
6056
status: status,
61-
out: String::from_utf8(stdout).unwrap(),
62-
err: String::from_utf8(stderr).unwrap()
57+
out: String::from_utf8(output).unwrap(),
58+
err: String::from_utf8(error).unwrap()
6359
})
6460
},
6561
Err(..) => None
@@ -71,16 +67,13 @@ pub fn run_background(lib_path: &str,
7167
aux_path: Option<&str>,
7268
args: &[String],
7369
env: Vec<(String, String)> ,
74-
input: Option<String>) -> Option<Child> {
70+
input: Option<String>) -> Option<Process> {
7571

7672
let mut cmd = Command::new(prog);
77-
cmd.args(args)
78-
.stdin(Stdio::piped())
79-
.stdout(Stdio::piped())
80-
.stderr(Stdio::piped());
73+
cmd.args(args);
8174
add_target_env(&mut cmd, lib_path, aux_path);
8275
for (key, val) in env {
83-
cmd.env(&key, &val);
76+
cmd.env(key, val);
8477
}
8578

8679
match cmd.spawn() {

0 commit comments

Comments
 (0)