Skip to content

Commit d9f6bc3

Browse files
committed
Keep lines <= 100 chars, add po test for Path
1 parent 9768e71 commit d9f6bc3

File tree

2 files changed

+5
-41
lines changed

2 files changed

+5
-41
lines changed

src/etc/rust_types.py

-16
Original file line numberDiff line numberDiff line change
@@ -53,22 +53,6 @@ class RustType(object):
5353
STD_REF_MUT_REGEX = re.compile(r"^(core::([a-z_]+::)+)RefMut<.+>$")
5454
STD_REF_CELL_REGEX = re.compile(r"^(core::([a-z_]+::)+)RefCell<.+>$")
5555
STD_NONZERO_NUMBER_REGEX = re.compile(r"^(core::([a-z_]+::)+)NonZero<.+>$")
56-
STD_OS_STRING_REGEX = re.compile(r"^(std::ffi::(\w+::)+)OsString$")
57-
STD_VEC_REGEX = re.compile(r"^(alloc::(\w+::)+)Vec<.+>$")
58-
STD_VEC_DEQUE_REGEX = re.compile(r"^(alloc::(\w+::)+)VecDeque<.+>$")
59-
STD_BTREE_SET_REGEX = re.compile(r"^(alloc::(\w+::)+)BTreeSet<.+>$")
60-
STD_BTREE_MAP_REGEX = re.compile(r"^(alloc::(\w+::)+)BTreeMap<.+>$")
61-
STD_HASH_MAP_REGEX = re.compile(r"^(std::collections::(\w+::)+)HashMap<.+>$")
62-
STD_HASH_SET_REGEX = re.compile(r"^(std::collections::(\w+::)+)HashSet<.+>$")
63-
STD_RC_REGEX = re.compile(r"^(alloc::(\w+::)+)Rc<.+>$")
64-
STD_ARC_REGEX = re.compile(r"^(alloc::(\w+::)+)Arc<.+>$")
65-
STD_CELL_REGEX = re.compile(r"^(core::(\w+::)+)Cell<.+>$")
66-
STD_REF_REGEX = re.compile(r"^(core::(\w+::)+)Ref<.+>$")
67-
STD_REF_MUT_REGEX = re.compile(r"^(core::(\w+::)+)RefMut<.+>$")
68-
STD_REF_CELL_REGEX = re.compile(r"^(core::(\w+::)+)RefCell<.+>$")
69-
STD_NONZERO_NUMBER_REGEX = re.compile(r"^core::num::([a-z_]+::)*NonZero.+$")
70-
STD_PATHBUF_REGEX = re.compile(r"^(std::([a-z_]+::)+)PathBuf$")
71-
STD_PATH_REGEX = re.compile(r"^&(mut )?(std::([a-z_]+::)+)Path$")
7256

7357
TUPLE_ITEM_REGEX = re.compile(r"__\d+$")
7458

src/tools/compiletest/src/runtest.rs

+5-25
Original file line numberDiff line numberDiff line change
@@ -272,19 +272,11 @@ impl<'test> TestCx<'test> {
272272
Ui | MirOpt => false,
273273
mode => panic!("unimplemented for mode {:?}", mode),
274274
};
275-
if test_should_run {
276-
self.run_if_enabled()
277-
} else {
278-
WillExecute::No
279-
}
275+
if test_should_run { self.run_if_enabled() } else { WillExecute::No }
280276
}
281277

282278
fn run_if_enabled(&self) -> WillExecute {
283-
if self.config.run_enabled() {
284-
WillExecute::Yes
285-
} else {
286-
WillExecute::Disabled
287-
}
279+
if self.config.run_enabled() { WillExecute::Yes } else { WillExecute::Disabled }
288280
}
289281

290282
fn should_run_successfully(&self, pm: Option<PassMode>) -> bool {
@@ -2693,11 +2685,7 @@ impl<'test> TestCx<'test> {
26932685
/// The revision, ignored for incremental compilation since it wants all revisions in
26942686
/// the same directory.
26952687
fn safe_revision(&self) -> Option<&str> {
2696-
if self.config.mode == Incremental {
2697-
None
2698-
} else {
2699-
self.revision
2700-
}
2688+
if self.config.mode == Incremental { None } else { self.revision }
27012689
}
27022690

27032691
/// Gets the absolute path to the directory where all output for the given
@@ -2920,11 +2908,7 @@ impl<'test> TestCx<'test> {
29202908

29212909
fn charset() -> &'static str {
29222910
// FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset
2923-
if cfg!(target_os = "freebsd") {
2924-
"ISO-8859-1"
2925-
} else {
2926-
"UTF-8"
2927-
}
2911+
if cfg!(target_os = "freebsd") { "ISO-8859-1" } else { "UTF-8" }
29282912
}
29292913

29302914
fn run_rustdoc_test(&self) {
@@ -4715,11 +4699,7 @@ impl<'test> TestCx<'test> {
47154699
for output_file in files {
47164700
println!("Actual {} saved to {}", kind, output_file.display());
47174701
}
4718-
if self.config.bless {
4719-
0
4720-
} else {
4721-
1
4722-
}
4702+
if self.config.bless { 0 } else { 1 }
47234703
}
47244704

47254705
fn check_and_prune_duplicate_outputs(

0 commit comments

Comments
 (0)