Simplified 3 ifs found by clippy.

This commit is contained in:
Nicholas-Baron 2021-10-09 12:15:14 -07:00
parent d2a522f423
commit 2d827ca3b8

View File

@ -232,10 +232,8 @@ impl<'test> TestCx<'test> {
/// Code executed for each revision in turn (or, if there are no /// Code executed for each revision in turn (or, if there are no
/// revisions, exactly once, with revision == None). /// revisions, exactly once, with revision == None).
fn run_revision(&self) { fn run_revision(&self) {
if self.props.should_ice { if self.props.should_ice && self.config.mode != Incremental {
if self.config.mode != Incremental { self.fatal("cannot use should-ice in a test that is not cfail");
self.fatal("cannot use should-ice in a test that is not cfail");
}
} }
match self.config.mode { match self.config.mode {
RunPassValgrind => self.run_valgrind_test(), RunPassValgrind => self.run_valgrind_test(),
@ -3162,11 +3160,10 @@ impl<'test> TestCx<'test> {
if !proc_res.status.success() { if !proc_res.status.success() {
self.fatal_proc_rec("test run failed!", &proc_res); self.fatal_proc_rec("test run failed!", &proc_res);
} }
} else { } else if proc_res.status.success() {
if proc_res.status.success() { self.fatal_proc_rec("test run succeeded!", &proc_res);
self.fatal_proc_rec("test run succeeded!", &proc_res);
}
} }
if !self.props.error_patterns.is_empty() { if !self.props.error_patterns.is_empty() {
// "// error-pattern" comments // "// error-pattern" comments
self.check_error_patterns(&proc_res.stderr, &proc_res, pm); self.check_error_patterns(&proc_res.stderr, &proc_res, pm);
@ -3213,10 +3210,11 @@ impl<'test> TestCx<'test> {
if !res.status.success() { if !res.status.success() {
self.fatal_proc_rec("failed to compile fixed code", &res); self.fatal_proc_rec("failed to compile fixed code", &res);
} }
if !res.stderr.is_empty() && !self.props.rustfix_only_machine_applicable { if !res.stderr.is_empty()
if !json::rustfix_diagnostics_only(&res.stderr).is_empty() { && !self.props.rustfix_only_machine_applicable
self.fatal_proc_rec("fixed code is still producing diagnostics", &res); && !json::rustfix_diagnostics_only(&res.stderr).is_empty()
} {
self.fatal_proc_rec("fixed code is still producing diagnostics", &res);
} }
} }
} }