Skip to content

Commit 9257c40

Browse files
committed
---
yaml --- r: 189355 b: refs/heads/master c: 36c3612 h: refs/heads/master i: 189353: 8706d91 189351: 7c3e14b v: v3
1 parent 9a83b7e commit 9257c40

File tree

602 files changed

+7716
-4667
lines changed

Some content is hidden

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

602 files changed

+7716
-4667
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: de44baac8b0f2eed0fa4c1511e983da431cb2134
2+
refs/heads/master: 36c3612f5ceae0fb9df4127bc94a5b443874d1ca
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 270a677d4d698916f5ad103f0afc3c070b8dbeb4
55
refs/heads/try: 649d35e4d830b27806705dc5352c86ab6d6fd1a1

trunk/configure

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,10 @@ case $CFG_OSTYPE in
430430
CFG_CPUTYPE=x86_64
431431
;;
432432

433+
# Win 8 # uname -s on 64-bit cygwin does not contain WOW64, so simply use uname -m to detect arch (works in my install)
434+
CYGWIN_NT-6.3)
435+
CFG_OSTYPE=pc-windows-gnu
436+
;;
433437
# We do not detect other OS such as XP/2003 using 64 bit using uname.
434438
# If we want to in the future, we will need to use Cygwin - Chuck's csih helper in /usr/lib/csih/winProductName.exe or alternative.
435439
*)
@@ -697,15 +701,17 @@ probe CFG_ADB adb
697701

698702
if [ ! -z "$CFG_PANDOC" ]
699703
then
700-
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc\(.exe\)\? ' |
701-
# extract the first 2 version fields, ignore everything else
702-
sed 's/pandoc\(.exe\)\? \([0-9]*\)\.\([0-9]*\).*/\2 \3/')
704+
PV_MAJOR_MINOR=$(pandoc --version | grep '^pandoc' |
705+
# Extract "MAJOR MINOR" from Pandoc's version number
706+
sed -E 's/pandoc(.exe)? ([0-9]+)\.([0-9]+).*/\2 \3/')
703707

704708
MIN_PV_MAJOR="1"
705709
MIN_PV_MINOR="9"
710+
706711
# these patterns are shell globs, *not* regexps
707712
PV_MAJOR=${PV_MAJOR_MINOR% *}
708713
PV_MINOR=${PV_MAJOR_MINOR#* }
714+
709715
if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ]
710716
then
711717
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"

trunk/mk/docs.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,13 @@ 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: $@)
276277
$(Q)rm -rf doc/book
277278
$(Q)$(RUSTBOOK) build $(S)src/doc/trpl doc/book
278279

279280
style: doc/style/index.html
280281

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

trunk/mk/main.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.0.0
1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
2020
# versions (section 9)
21-
CFG_PRERELEASE_VERSION=.2
21+
CFG_PRERELEASE_VERSION=
2222

2323
CFG_FILENAME_EXTRA=4e7c5e5c
2424

@@ -30,8 +30,8 @@ CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)
3030
CFG_DISABLE_UNSTABLE_FEATURES=1
3131
endif
3232
ifeq ($(CFG_RELEASE_CHANNEL),beta)
33-
CFG_RELEASE=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
34-
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-alpha$(CFG_PRERELEASE_VERSION)
33+
CFG_RELEASE=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
34+
CFG_PACKAGE_VERS=$(CFG_RELEASE_NUM)-beta(CFG_PRERELEASE_VERSION)
3535
CFG_DISABLE_UNSTABLE_FEATURES=1
3636
endif
3737
ifeq ($(CFG_RELEASE_CHANNEL),nightly)

trunk/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 --cfg ndebug,,$$(CFG_RUSTC_FLAGS))
593+
CTEST_RUSTC_FLAGS := $$(subst -C debug-assertions,,$$(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

trunk/src/compiletest/common.rs

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

1212
use std::fmt;
1313
use std::str::FromStr;
14+
use std::path::PathBuf;
1415

1516
#[derive(Clone, Copy, PartialEq, Debug)]
1617
pub enum Mode {
@@ -68,13 +69,13 @@ pub struct Config {
6869
pub run_lib_path: String,
6970

7071
// The rustc executable
71-
pub rustc_path: Path,
72+
pub rustc_path: PathBuf,
7273

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

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

7980
// The valgrind path
8081
pub valgrind_path: Option<String>,
@@ -84,13 +85,13 @@ pub struct Config {
8485
pub force_valgrind: bool,
8586

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

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

9293
// Directory for auxiliary libraries
93-
pub aux_base: Path,
94+
pub aux_base: PathBuf,
9495

9596
// The name of the stage being built (stage1, etc)
9697
pub stage_id: String,
@@ -105,7 +106,7 @@ pub struct Config {
105106
pub filter: Option<String>,
106107

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

110111
// A command line to prefix program execution with,
111112
// for running under valgrind
@@ -133,7 +134,7 @@ pub struct Config {
133134
pub lldb_version: Option<String>,
134135

135136
// Path to the android tools
136-
pub android_cross_path: Path,
137+
pub android_cross_path: PathBuf,
137138

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

trunk/src/compiletest/compiletest.rs

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
#![feature(test)]
2222
#![feature(unicode)]
2323
#![feature(core)]
24+
#![feature(path)]
25+
#![feature(io)]
26+
#![feature(net)]
27+
#![feature(path_ext)]
2428

2529
#![deny(warnings)]
2630

@@ -31,8 +35,9 @@ extern crate getopts;
3135
extern crate log;
3236

3337
use std::env;
38+
use std::fs;
3439
use std::old_io;
35-
use std::old_io::fs;
40+
use std::path::{Path, PathBuf};
3641
use std::thunk::Thunk;
3742
use getopts::{optopt, optflag, reqopt};
3843
use common::Config;
@@ -114,9 +119,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
114119
panic!()
115120
}
116121

117-
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
122+
fn opt_path(m: &getopts::Matches, nm: &str) -> PathBuf {
118123
match m.opt_str(nm) {
119-
Some(s) => Path::new(s),
124+
Some(s) => PathBuf::new(&s),
120125
None => panic!("no option (=path) found for {}", nm),
121126
}
122127
}
@@ -131,18 +136,18 @@ pub fn parse_config(args: Vec<String> ) -> Config {
131136
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
132137
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
133138
rustc_path: opt_path(matches, "rustc-path"),
134-
clang_path: matches.opt_str("clang-path").map(|s| Path::new(s)),
139+
clang_path: matches.opt_str("clang-path").map(|s| PathBuf::new(&s)),
135140
valgrind_path: matches.opt_str("valgrind-path"),
136141
force_valgrind: matches.opt_present("force-valgrind"),
137-
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::new(s)),
142+
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| PathBuf::new(&s)),
138143
src_base: opt_path(matches, "src-base"),
139144
build_base: opt_path(matches, "build-base"),
140145
aux_base: opt_path(matches, "aux-base"),
141146
stage_id: matches.opt_str("stage-id").unwrap(),
142147
mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
143148
run_ignored: matches.opt_present("ignored"),
144149
filter: filter,
145-
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
150+
logfile: matches.opt_str("logfile").map(|s| PathBuf::new(&s)),
146151
runtool: matches.opt_str("runtool"),
147152
host_rustcflags: matches.opt_str("host-rustcflags"),
148153
target_rustcflags: matches.opt_str("target-rustcflags"),
@@ -276,9 +281,9 @@ pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
276281
debug!("making tests from {:?}",
277282
config.src_base.display());
278283
let mut tests = Vec::new();
279-
let dirs = fs::readdir(&config.src_base).unwrap();
280-
for file in &dirs {
281-
let file = file.clone();
284+
let dirs = fs::read_dir(&config.src_base).unwrap();
285+
for file in dirs {
286+
let file = file.unwrap().path();
282287
debug!("inspecting file {:?}", file.display());
283288
if is_test(config, &file) {
284289
let t = make_test(config, &file, || {
@@ -301,7 +306,7 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {
301306
_ => vec!(".rc".to_string(), ".rs".to_string())
302307
};
303308
let invalid_prefixes = vec!(".".to_string(), "#".to_string(), "~".to_string());
304-
let name = testfile.filename_str().unwrap();
309+
let name = testfile.file_name().unwrap().to_str().unwrap();
305310

306311
let mut valid = false;
307312

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

338343
// Try to elide redundant long paths
339344
fn shorten(path: &Path) -> String {
340-
let filename = path.filename_str();
341-
let p = path.dir_path();
342-
let dir = p.filename_str();
345+
let filename = path.file_name().unwrap().to_str();
346+
let p = path.parent().unwrap();
347+
let dir = p.file_name().unwrap().to_str();
343348
format!("{}/{}", dir.unwrap_or(""), filename.unwrap_or(""))
344349
}
345350

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

349354
pub fn make_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
350355
let config = (*config).clone();
351-
// FIXME (#9639): This needs to handle non-utf8 paths
352-
let testfile = testfile.as_str().unwrap().to_string();
356+
let testfile = testfile.to_path_buf();
353357
test::DynTestFn(Thunk::new(move || {
354-
runtest::run(config, testfile)
358+
runtest::run(config, &testfile)
355359
}))
356360
}
357361

358362
pub fn make_metrics_test_closure(config: &Config, testfile: &Path) -> test::TestFn {
359363
let config = (*config).clone();
360-
// FIXME (#9639): This needs to handle non-utf8 paths
361-
let testfile = testfile.as_str().unwrap().to_string();
364+
let testfile = testfile.to_path_buf();
362365
test::DynMetricFn(box move |mm: &mut test::MetricMap| {
363-
runtest::run_metrics(config, testfile, mm)
366+
runtest::run_metrics(config, &testfile, mm)
364367
})
365368
}
366369

trunk/src/compiletest/errors.rs

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

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

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

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

trunk/src/compiletest/header.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
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};
1216

1317
use common::Config;
1418
use common;
@@ -23,7 +27,7 @@ pub struct TestProps {
2327
pub run_flags: Option<String>,
2428
// If present, the name of a file that this test should match when
2529
// pretty-printed
26-
pub pp_exact: Option<Path>,
30+
pub pp_exact: Option<PathBuf>,
2731
// Modules from aux directory that should be compiled
2832
pub aux_builds: Vec<String> ,
2933
// Environment settings to use during execution
@@ -62,7 +66,7 @@ pub fn load_props(testfile: &Path) -> TestProps {
6266
let mut pretty_mode = None;
6367
let mut pretty_compare_only = false;
6468
let mut forbid_output = Vec::new();
65-
iter_header(testfile, |ln| {
69+
iter_header(testfile, &mut |ln| {
6670
match parse_error_pattern(ln) {
6771
Some(ep) => error_patterns.push(ep),
6872
None => ()
@@ -219,7 +223,7 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
219223
}
220224
}
221225

222-
let val = iter_header(testfile, |ln| {
226+
let val = iter_header(testfile, &mut |ln| {
223227
!parse_name_directive(ln, "ignore-test") &&
224228
!parse_name_directive(ln, &ignore_target(config)) &&
225229
!parse_name_directive(ln, &ignore_stage(config)) &&
@@ -232,12 +236,8 @@ pub fn is_test_ignored(config: &Config, testfile: &Path) -> bool {
232236
!val
233237
}
234238

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());
239+
fn iter_header(testfile: &Path, it: &mut FnMut(&str) -> bool) -> bool {
240+
let rdr = BufReader::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<Path> {
325+
fn parse_pp_exact(line: &str, testfile: &Path) -> Option<PathBuf> {
326326
match parse_name_value_directive(line, "pp-exact") {
327-
Some(s) => Some(Path::new(s)),
327+
Some(s) => Some(PathBuf::new(&s)),
328328
None => {
329329
if parse_name_directive(line, "pp-exact") {
330-
testfile.filename().map(|s| Path::new(s))
330+
testfile.file_name().map(|s| PathBuf::new(s))
331331
} else {
332332
None
333333
}

0 commit comments

Comments
 (0)