Skip to content

Commit 9422c01

Browse files
committed
---
yaml --- r: 189023 b: refs/heads/tmp c: bedfca0 h: refs/heads/master i: 189021: b0b1917 189019: 47d2596 189015: 27aa3dd 189007: 00ef3e6 188991: 7bf4fe6 v: v3
1 parent 749fe4c commit 9422c01

File tree

393 files changed

+3449
-2463
lines changed

Some content is hidden

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

393 files changed

+3449
-2463
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 9893b44ad9a9c3a23067a083ed0e0a08c2e83886
37+
refs/heads/tmp: bedfca0fb323e040ca63d0db5d45b8071529aef9
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/tmp/mk/debuggers.mk

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,32 @@ define DEF_INSTALL_DEBUGGER_SCRIPTS_HOST
5656
tmp/install-debugger-scripts$(1)_H_$(2)-gdb.done: \
5757
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) \
5858
$$(DEBUGGER_BIN_SCRIPTS_GDB_ABS)
59+
$(Q)touch $$@.start_time
5960
$(Q)mkdir -p $$(HBIN$(1)_H_$(2))
6061
$(Q)mkdir -p $$(HLIB$(1)_H_$(2))/rustlib/etc
6162
$(Q)install $$(DEBUGGER_BIN_SCRIPTS_GDB_ABS) $$(HBIN$(1)_H_$(2))
6263
$(Q)install $$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) $$(HLIB$(1)_H_$(2))/rustlib/etc
63-
$(Q)touch $$@
64+
$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
6465

6566
tmp/install-debugger-scripts$(1)_H_$(2)-lldb.done: \
6667
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS) \
6768
$$(DEBUGGER_BIN_SCRIPTS_LLDB_ABS)
69+
$(Q)touch $$@.start_time
6870
$(Q)mkdir -p $$(HBIN$(1)_H_$(2))
6971
$(Q)mkdir -p $$(HLIB$(1)_H_$(2))/rustlib/etc
7072
$(Q)install $$(DEBUGGER_BIN_SCRIPTS_LLDB_ABS) $$(HBIN$(1)_H_$(2))
7173
$(Q)install $$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS) $$(HLIB$(1)_H_$(2))/rustlib/etc
72-
$(Q)touch $$@
74+
$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
7375

7476
tmp/install-debugger-scripts$(1)_H_$(2)-all.done: \
7577
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS) \
7678
$$(DEBUGGER_BIN_SCRIPTS_ALL_ABS)
79+
$(Q)touch $$@.start_time
7780
$(Q)mkdir -p $$(HBIN$(1)_H_$(2))
7881
$(Q)mkdir -p $$(HLIB$(1)_H_$(2))/rustlib/etc
7982
$(Q)install $$(DEBUGGER_BIN_SCRIPTS_ALL_ABS) $$(HBIN$(1)_H_$(2))
8083
$(Q)install $$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS) $$(HLIB$(1)_H_$(2))/rustlib/etc
81-
$(Q)touch $$@
84+
$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
8285

8386
tmp/install-debugger-scripts$(1)_H_$(2)-none.done:
8487
$(Q)touch $$@
@@ -98,29 +101,32 @@ define DEF_INSTALL_DEBUGGER_SCRIPTS_TARGET
98101
tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3)-gdb.done: \
99102
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) \
100103
$$(DEBUGGER_BIN_SCRIPTS_GDB_ABS)
104+
$(Q)touch $$@.start_time
101105
$(Q)mkdir -p $$(TBIN$(1)_T_$(2)_H_$(3))
102106
$(Q)mkdir -p $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
103107
$(Q)install $(DEBUGGER_BIN_SCRIPTS_GDB_ABS) $$(TBIN$(1)_T_$(2)_H_$(3))
104108
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_GDB_ABS) $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
105-
$(Q)touch $$@
109+
$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
106110

107111
tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3)-lldb.done: \
108112
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS) \
109113
$$(DEBUGGER_BIN_SCRIPTS_LLDB_ABS)
114+
$(Q)touch $$@.start_time
110115
$(Q)mkdir -p $$(TBIN$(1)_T_$(2)_H_$(3))
111116
$(Q)mkdir -p $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
112117
$(Q)install $(DEBUGGER_BIN_SCRIPTS_LLDB_ABS) $$(TBIN$(1)_T_$(2)_H_$(3))
113118
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_LLDB_ABS) $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
114-
$(Q)touch $$@
119+
$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
115120

116121
tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3)-all.done: \
117122
$$(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS) \
118123
$$(DEBUGGER_BIN_SCRIPTS_ALL_ABS)
124+
$(Q)touch $$@.start_time
119125
$(Q)mkdir -p $$(TBIN$(1)_T_$(2)_H_$(3))
120126
$(Q)mkdir -p $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
121127
$(Q)install $(DEBUGGER_BIN_SCRIPTS_ALL_ABS) $$(TBIN$(1)_T_$(2)_H_$(3))
122128
$(Q)install $(DEBUGGER_RUSTLIB_ETC_SCRIPTS_ALL_ABS) $$(TLIB$(1)_T_$(2)_H_$(3))/rustlib/etc
123-
$(Q)touch $$@
129+
$(Q)touch -r $$@.start_time $$@ && rm $$@.start_time
124130

125131
tmp/install-debugger-scripts$(1)_T_$(2)_H_$(3)-none.done:
126132
$(Q)touch $$@

branches/tmp/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

branches/tmp/mk/llvm.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ endif
3838
# the stamp in the source dir.
3939
$$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
4040
@$$(call E, make: cleaning llvm)
41+
$(Q)touch $$@.start_time
4142
$(Q)$(MAKE) clean-llvm$(1)
4243
@$$(call E, make: done cleaning llvm)
43-
touch $$@
44+
touch -r $$@.start_time $$@ && rm $$@.start_time
4445

4546
ifeq ($$(CFG_ENABLE_LLVM_STATIC_STDCPP),1)
4647
LLVM_STDCPP_LOCATION_$(1) = $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \

branches/tmp/mk/target.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
7575
$$(TSREQ$(1)_T_$(2)_H_$(3)) \
7676
| $$(TLIB$(1)_T_$(2)_H_$(3))/
7777
@$$(call E, rustc: $$(@D)/lib$(4))
78+
@touch $$@.start_time
7879
$$(call REMOVE_ALL_OLD_GLOB_MATCHES, \
7980
$$(dir $$@)$$(call CFG_LIB_GLOB_$(2),$(4)))
8081
$$(call REMOVE_ALL_OLD_GLOB_MATCHES, \
@@ -89,7 +90,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8990
--out-dir $$(@D) \
9091
-C extra-filename=-$$(CFG_FILENAME_EXTRA) \
9192
$$<
92-
@touch $$@
93+
@touch -r $$@.start_time $$@ && rm $$@.start_time
9394
$$(call LIST_ALL_OLD_GLOB_MATCHES, \
9495
$$(dir $$@)$$(call CFG_LIB_GLOB_$(2),$(4)))
9596
$$(call LIST_ALL_OLD_GLOB_MATCHES, \

branches/tmp/mk/tests.mk

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,11 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4
389389
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
390390
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
391391
@$$(call E, run: $$<)
392+
$$(Q)touch $$@.start_time
392393
$$(Q)$$(call CFG_RUN_TEST_$(2),$$<,$(1),$(2),$(3)) $$(TESTARGS) \
393394
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
394395
$$(call CRATE_TEST_EXTRA_ARGS,$(1),$(2),$(3),$(4)) \
395-
&& touch $$@
396+
&& touch -r $$@.start_time $$@ && rm $$@.start_time
396397
endef
397398

398399
define DEF_TEST_CRATE_RULES_android
@@ -401,6 +402,7 @@ check-stage$(1)-T-$(2)-H-$(3)-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4
401402
$$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
402403
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2))
403404
@$$(call E, run: $$< via adb)
405+
$$(Q)touch $$@.start_time
404406
$$(Q)$(CFG_ADB) push $$< $(CFG_ADB_TEST_DIR)
405407
$$(Q)$(CFG_ADB) shell '(cd $(CFG_ADB_TEST_DIR); LD_LIBRARY_PATH=./$(2) \
406408
./$$(notdir $$<) \
@@ -414,7 +416,7 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
414416
@if grep -q "result: ok" tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
415417
then \
416418
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
417-
touch $$@; \
419+
touch -r $$@.start_time $$@ && rm $$@.start_time; \
418420
else \
419421
rm tmp/check-stage$(1)-T-$(2)-H-$(3)-$(4).tmp; \
420422
exit 101; \
@@ -690,10 +692,11 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
690692
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
691693
$$(CTEST_DEPS_$(4)_$(1)-T-$(2)-H-$(3))
692694
@$$(call E, run $(4) [$(2)]: $$<)
695+
$$(Q)touch [email protected]_time
693696
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
694697
$$(CTEST_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
695698
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
696-
&& touch $$@
699+
&& touch -r $$@.start_time $$@ && rm [email protected]_time
697700

698701
else
699702

@@ -750,10 +753,11 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),$(4)): \
750753
$$(PRETTY_DEPS_$(4)) \
751754
$$(PRETTY_DEPS$(1)_H_$(3)_$(4))
752755
@$$(call E, run pretty-rpass [$(2)]: $$<)
756+
$$(Q)touch $$@.start_time
753757
$$(Q)$$(call CFG_RUN_CTEST_$(2),$(1),$$<,$(3)) \
754758
$$(PRETTY_ARGS$(1)-T-$(2)-H-$(3)-$(4)) \
755759
--logfile $$(call TEST_LOG_FILE,$(1),$(2),$(3),$(4)) \
756-
&& touch $$@
760+
&& touch -r $$@.start_time $$@ && rm $$@.start_time
757761

758762
endef
759763

@@ -799,8 +803,10 @@ endif
799803
ifeq ($(2),$$(CFG_BUILD))
800804
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
801805
@$$(call E, run doc-$(4) [$(2)])
806+
$$(Q)touch $$@.start_time
802807
$$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --cfg dox --test $$< \
803-
--test-args "$$(TESTARGS)" && touch $$@
808+
--test-args "$$(TESTARGS)" && \
809+
touch -r $$@.start_time $$@ && rm $$@.start_time
804810
else
805811
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)):
806812
touch $$@
@@ -835,9 +841,11 @@ check-stage$(1)-T-$(2)-H-$(3)-doc-crate-$(4)-exec: \
835841
ifeq ($(2),$$(CFG_BUILD))
836842
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
837843
@$$(call E, run doc-crate-$(4) [$(2)])
844+
$$(Q)touch $$@.start_time
838845
$$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(3)) \
839846
$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
840-
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
847+
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && \
848+
touch -r $$@.start_time $$@ && rm $$@.start_time
841849
else
842850
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)):
843851
touch $$@
@@ -984,6 +992,7 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
984992
$$(CSREQ$(1)_T_$(2)_H_$(3))
985993
@rm -rf $(3)/test/run-make/$$*
986994
@mkdir -p $(3)/test/run-make/$$*
995+
$$(Q)touch $$@.start_time
987996
$$(Q)$$(CFG_PYTHON) $(S)src/etc/maketest.py $$(dir $$<) \
988997
$$(MAKE) \
989998
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
@@ -996,7 +1005,7 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
9961005
"$$(LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3))" \
9971006
$(1) \
9981007
$$(S)
999-
@touch $$@
1008+
@touch -r $$@.start_time $$@ && rm [email protected]_time
10001009
else
10011010
# FIXME #11094 - The above rule doesn't work right for multiple targets
10021011
check-stage$(1)-T-$(2)-H-$(3)-rmake-exec:

branches/tmp/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,

branches/tmp/src/compiletest/compiletest.rs

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

2530
#![deny(warnings)]
2631

@@ -31,8 +36,9 @@ extern crate getopts;
3136
extern crate log;
3237

3338
use std::env;
39+
use std::fs;
3440
use std::old_io;
35-
use std::old_io::fs;
41+
use std::path::{Path, PathBuf};
3642
use std::thunk::Thunk;
3743
use getopts::{optopt, optflag, reqopt};
3844
use common::Config;
@@ -114,9 +120,9 @@ pub fn parse_config(args: Vec<String> ) -> Config {
114120
panic!()
115121
}
116122

117-
fn opt_path(m: &getopts::Matches, nm: &str) -> Path {
123+
fn opt_path(m: &getopts::Matches, nm: &str) -> PathBuf {
118124
match m.opt_str(nm) {
119-
Some(s) => Path::new(s),
125+
Some(s) => PathBuf::new(&s),
120126
None => panic!("no option (=path) found for {}", nm),
121127
}
122128
}
@@ -131,18 +137,18 @@ pub fn parse_config(args: Vec<String> ) -> Config {
131137
compile_lib_path: matches.opt_str("compile-lib-path").unwrap(),
132138
run_lib_path: matches.opt_str("run-lib-path").unwrap(),
133139
rustc_path: opt_path(matches, "rustc-path"),
134-
clang_path: matches.opt_str("clang-path").map(|s| Path::new(s)),
140+
clang_path: matches.opt_str("clang-path").map(|s| PathBuf::new(&s)),
135141
valgrind_path: matches.opt_str("valgrind-path"),
136142
force_valgrind: matches.opt_present("force-valgrind"),
137-
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| Path::new(s)),
143+
llvm_bin_path: matches.opt_str("llvm-bin-path").map(|s| PathBuf::new(&s)),
138144
src_base: opt_path(matches, "src-base"),
139145
build_base: opt_path(matches, "build-base"),
140146
aux_base: opt_path(matches, "aux-base"),
141147
stage_id: matches.opt_str("stage-id").unwrap(),
142148
mode: matches.opt_str("mode").unwrap().parse().ok().expect("invalid mode"),
143149
run_ignored: matches.opt_present("ignored"),
144150
filter: filter,
145-
logfile: matches.opt_str("logfile").map(|s| Path::new(s)),
151+
logfile: matches.opt_str("logfile").map(|s| PathBuf::new(&s)),
146152
runtool: matches.opt_str("runtool"),
147153
host_rustcflags: matches.opt_str("host-rustcflags"),
148154
target_rustcflags: matches.opt_str("target-rustcflags"),
@@ -276,9 +282,9 @@ pub fn make_tests(config: &Config) -> Vec<test::TestDescAndFn> {
276282
debug!("making tests from {:?}",
277283
config.src_base.display());
278284
let mut tests = Vec::new();
279-
let dirs = fs::readdir(&config.src_base).unwrap();
280-
for file in &dirs {
281-
let file = file.clone();
285+
let dirs = fs::read_dir(&config.src_base).unwrap();
286+
for file in dirs {
287+
let file = file.unwrap().path();
282288
debug!("inspecting file {:?}", file.display());
283289
if is_test(config, &file) {
284290
let t = make_test(config, &file, || {
@@ -301,7 +307,7 @@ pub fn is_test(config: &Config, testfile: &Path) -> bool {
301307
_ => vec!(".rc".to_string(), ".rs".to_string())
302308
};
303309
let invalid_prefixes = vec!(".".to_string(), "#".to_string(), "~".to_string());
304-
let name = testfile.filename_str().unwrap();
310+
let name = testfile.file_name().unwrap().to_str().unwrap();
305311

306312
let mut valid = false;
307313

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

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

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

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

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

0 commit comments

Comments
 (0)