Skip to content

Commit

Permalink
Keep lines <= 100 chars, add po test for Path
Browse files Browse the repository at this point in the history
  • Loading branch information
n8henrie committed Mar 17, 2024
1 parent 9768e71 commit d9f6bc3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 41 deletions.
16 changes: 0 additions & 16 deletions src/etc/rust_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,6 @@ class RustType(object):
STD_REF_MUT_REGEX = re.compile(r"^(core::([a-z_]+::)+)RefMut<.+>$")
STD_REF_CELL_REGEX = re.compile(r"^(core::([a-z_]+::)+)RefCell<.+>$")
STD_NONZERO_NUMBER_REGEX = re.compile(r"^(core::([a-z_]+::)+)NonZero<.+>$")
STD_OS_STRING_REGEX = re.compile(r"^(std::ffi::(\w+::)+)OsString$")
STD_VEC_REGEX = re.compile(r"^(alloc::(\w+::)+)Vec<.+>$")
STD_VEC_DEQUE_REGEX = re.compile(r"^(alloc::(\w+::)+)VecDeque<.+>$")
STD_BTREE_SET_REGEX = re.compile(r"^(alloc::(\w+::)+)BTreeSet<.+>$")
STD_BTREE_MAP_REGEX = re.compile(r"^(alloc::(\w+::)+)BTreeMap<.+>$")
STD_HASH_MAP_REGEX = re.compile(r"^(std::collections::(\w+::)+)HashMap<.+>$")
STD_HASH_SET_REGEX = re.compile(r"^(std::collections::(\w+::)+)HashSet<.+>$")
STD_RC_REGEX = re.compile(r"^(alloc::(\w+::)+)Rc<.+>$")
STD_ARC_REGEX = re.compile(r"^(alloc::(\w+::)+)Arc<.+>$")
STD_CELL_REGEX = re.compile(r"^(core::(\w+::)+)Cell<.+>$")
STD_REF_REGEX = re.compile(r"^(core::(\w+::)+)Ref<.+>$")
STD_REF_MUT_REGEX = re.compile(r"^(core::(\w+::)+)RefMut<.+>$")
STD_REF_CELL_REGEX = re.compile(r"^(core::(\w+::)+)RefCell<.+>$")
STD_NONZERO_NUMBER_REGEX = re.compile(r"^core::num::([a-z_]+::)*NonZero.+$")
STD_PATHBUF_REGEX = re.compile(r"^(std::([a-z_]+::)+)PathBuf$")
STD_PATH_REGEX = re.compile(r"^&(mut )?(std::([a-z_]+::)+)Path$")

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

Expand Down
30 changes: 5 additions & 25 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,11 @@ impl<'test> TestCx<'test> {
Ui | MirOpt => false,
mode => panic!("unimplemented for mode {:?}", mode),
};
if test_should_run {
self.run_if_enabled()
} else {
WillExecute::No
}
if test_should_run { self.run_if_enabled() } else { WillExecute::No }
}

fn run_if_enabled(&self) -> WillExecute {
if self.config.run_enabled() {
WillExecute::Yes
} else {
WillExecute::Disabled
}
if self.config.run_enabled() { WillExecute::Yes } else { WillExecute::Disabled }
}

fn should_run_successfully(&self, pm: Option<PassMode>) -> bool {
Expand Down Expand Up @@ -2693,11 +2685,7 @@ impl<'test> TestCx<'test> {
/// The revision, ignored for incremental compilation since it wants all revisions in
/// the same directory.
fn safe_revision(&self) -> Option<&str> {
if self.config.mode == Incremental {
None
} else {
self.revision
}
if self.config.mode == Incremental { None } else { self.revision }
}

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

fn charset() -> &'static str {
// FreeBSD 10.1 defaults to GDB 6.1.1 which doesn't support "auto" charset
if cfg!(target_os = "freebsd") {
"ISO-8859-1"
} else {
"UTF-8"
}
if cfg!(target_os = "freebsd") { "ISO-8859-1" } else { "UTF-8" }
}

fn run_rustdoc_test(&self) {
Expand Down Expand Up @@ -4715,11 +4699,7 @@ impl<'test> TestCx<'test> {
for output_file in files {
println!("Actual {} saved to {}", kind, output_file.display());
}
if self.config.bless {
0
} else {
1
}
if self.config.bless { 0 } else { 1 }
}

fn check_and_prune_duplicate_outputs(
Expand Down

0 comments on commit d9f6bc3

Please sign in to comment.