Skip to content

Commit 2d827ca

Browse files
Simplified 3 ifs found by clippy.
1 parent d2a522f commit 2d827ca

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,8 @@ impl<'test> TestCx<'test> {
232232
/// Code executed for each revision in turn (or, if there are no
233233
/// revisions, exactly once, with revision == None).
234234
fn run_revision(&self) {
235-
if self.props.should_ice {
236-
if self.config.mode != Incremental {
237-
self.fatal("cannot use should-ice in a test that is not cfail");
238-
}
235+
if self.props.should_ice && self.config.mode != Incremental {
236+
self.fatal("cannot use should-ice in a test that is not cfail");
239237
}
240238
match self.config.mode {
241239
RunPassValgrind => self.run_valgrind_test(),
@@ -3162,11 +3160,10 @@ impl<'test> TestCx<'test> {
31623160
if !proc_res.status.success() {
31633161
self.fatal_proc_rec("test run failed!", &proc_res);
31643162
}
3165-
} else {
3166-
if proc_res.status.success() {
3167-
self.fatal_proc_rec("test run succeeded!", &proc_res);
3168-
}
3163+
} else if proc_res.status.success() {
3164+
self.fatal_proc_rec("test run succeeded!", &proc_res);
31693165
}
3166+
31703167
if !self.props.error_patterns.is_empty() {
31713168
// "// error-pattern" comments
31723169
self.check_error_patterns(&proc_res.stderr, &proc_res, pm);
@@ -3213,10 +3210,11 @@ impl<'test> TestCx<'test> {
32133210
if !res.status.success() {
32143211
self.fatal_proc_rec("failed to compile fixed code", &res);
32153212
}
3216-
if !res.stderr.is_empty() && !self.props.rustfix_only_machine_applicable {
3217-
if !json::rustfix_diagnostics_only(&res.stderr).is_empty() {
3218-
self.fatal_proc_rec("fixed code is still producing diagnostics", &res);
3219-
}
3213+
if !res.stderr.is_empty()
3214+
&& !self.props.rustfix_only_machine_applicable
3215+
&& !json::rustfix_diagnostics_only(&res.stderr).is_empty()
3216+
{
3217+
self.fatal_proc_rec("fixed code is still producing diagnostics", &res);
32203218
}
32213219
}
32223220
}

0 commit comments

Comments
 (0)