about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPietro Albini <pietro.albini@ferrous-systems.com>2023-03-10 12:22:07 +0100
committerPietro Albini <pietro.albini@ferrous-systems.com>2023-04-03 09:30:26 +0200
commit8eb3def446b7026b2ff2a981791e5fc6fe031944 (patch)
treedd729eb494e1dc4967621a6d30a224b796126389
parent55121a9c460115a6a5758dd5b7057c20407f5b71 (diff)
downloadrust-8eb3def446b7026b2ff2a981791e5fc6fe031944.tar.gz
rust-8eb3def446b7026b2ff2a981791e5fc6fe031944.zip
handle "ignore-" and "only-"
-rw-r--r--src/tools/compiletest/src/header.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs
index 71e1072ceb3..b0b66e23201 100644
--- a/src/tools/compiletest/src/header.rs
+++ b/src/tools/compiletest/src/header.rs
@@ -697,6 +697,12 @@ impl Config {
         let (name, comment) =
             line.split_once(&[':', ' ']).map(|(l, c)| (l, Some(c))).unwrap_or((line, None));
 
+        // Some of the matchers might be "" depending on what the target information is. To avoid
+        // problems we outright reject empty directives.
+        if name == "" {
+            return ParsedNameDirective::invalid();
+        }
+
         let mut outcome = MatchOutcome::Invalid;
         let mut message = None;