about summary refs log tree commit diff
path: root/src/tools/compiletest
diff options
context:
space:
mode:
authorJakob Degen <jakob.e.degen@gmail.com>2022-12-04 02:23:21 -0800
committerJakob Degen <jakob.e.degen@gmail.com>2022-12-04 02:27:40 -0800
commit01a48982106fbcf4be448ad560d51fd91ace2b92 (patch)
treed141cd7c0108ef3990f3f283a9bc41e204655199 /src/tools/compiletest
parent23415176968e81e0aac92d0218612a89c4e68a82 (diff)
downloadrust-01a48982106fbcf4be448ad560d51fd91ace2b92.tar.gz
rust-01a48982106fbcf4be448ad560d51fd91ace2b92.zip
Fix --pass in compiletest
Diffstat (limited to 'src/tools/compiletest')
-rw-r--r--src/tools/compiletest/src/header.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 0d9a629e179..64d97e91442 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -260,9 +260,9 @@ impl TestProps {
         props.load_from(testfile, cfg, config);
 
         match (props.pass_mode, props.fail_mode) {
-            (None, None) => props.fail_mode = Some(FailMode::Check),
-            (Some(_), None) | (None, Some(_)) => {}
+            (None, None) if config.mode == Mode::Ui => props.fail_mode = Some(FailMode::Check),
             (Some(_), Some(_)) => panic!("cannot use a *-fail and *-pass mode together"),
+            _ => {}
         }
 
         props
@@ -522,8 +522,8 @@ impl TestProps {
     }
 
     pub fn pass_mode(&self, config: &Config) -> Option<PassMode> {
-        if !self.ignore_pass && self.fail_mode.is_none() && config.mode == Mode::Ui {
-            if let (mode @ Some(_), Some(_)) = (config.force_pass_mode, self.pass_mode) {
+        if !self.ignore_pass && self.fail_mode.is_none() {
+            if let mode @ Some(_) = config.force_pass_mode {
                 return mode;
             }
         }