diff options
| author | Nicholas-Baron <nicholas.baron.ten@gmail.com> | 2021-10-09 12:15:14 -0700 |
|---|---|---|
| committer | Nicholas-Baron <nicholas.baron.ten@gmail.com> | 2021-10-09 12:18:01 -0700 |
| commit | 2d827ca3b8490342f450cb205fc14c7db23b551e (patch) | |
| tree | abff19d43bc6cc3db7b65b37332c0c00559bb8fc | |
| parent | d2a522f4232c155bca29befc8c2800e906563c2a (diff) | |
| download | rust-2d827ca3b8490342f450cb205fc14c7db23b551e.tar.gz rust-2d827ca3b8490342f450cb205fc14c7db23b551e.zip | |
Simplified 3 ifs found by clippy.
| -rw-r--r-- | src/tools/compiletest/src/runtest.rs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 7e29b980ae1..4470272a9f8 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -232,10 +232,8 @@ impl<'test> TestCx<'test> { /// Code executed for each revision in turn (or, if there are no /// revisions, exactly once, with revision == None). fn run_revision(&self) { - if self.props.should_ice { - if self.config.mode != Incremental { - self.fatal("cannot use should-ice in a test that is not cfail"); - } + if self.props.should_ice && self.config.mode != Incremental { + self.fatal("cannot use should-ice in a test that is not cfail"); } match self.config.mode { RunPassValgrind => self.run_valgrind_test(), @@ -3162,11 +3160,10 @@ impl<'test> TestCx<'test> { if !proc_res.status.success() { self.fatal_proc_rec("test run failed!", &proc_res); } - } else { - if proc_res.status.success() { - self.fatal_proc_rec("test run succeeded!", &proc_res); - } + } else if proc_res.status.success() { + self.fatal_proc_rec("test run succeeded!", &proc_res); } + if !self.props.error_patterns.is_empty() { // "// error-pattern" comments self.check_error_patterns(&proc_res.stderr, &proc_res, pm); @@ -3213,10 +3210,11 @@ impl<'test> TestCx<'test> { if !res.status.success() { self.fatal_proc_rec("failed to compile fixed code", &res); } - if !res.stderr.is_empty() && !self.props.rustfix_only_machine_applicable { - if !json::rustfix_diagnostics_only(&res.stderr).is_empty() { - self.fatal_proc_rec("fixed code is still producing diagnostics", &res); - } + if !res.stderr.is_empty() + && !self.props.rustfix_only_machine_applicable + && !json::rustfix_diagnostics_only(&res.stderr).is_empty() + { + self.fatal_proc_rec("fixed code is still producing diagnostics", &res); } } } |
