about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZalathar <Zalathar@users.noreply.github.com>2025-09-30 12:20:42 +1000
committerZalathar <Zalathar@users.noreply.github.com>2025-09-30 12:37:46 +1000
commitffaf607cf2743f1206a739e02f7b194a4767f9a8 (patch)
tree9c493ff255d0c174bed2fcad636c56e42d3677b1
parent505a2084e683662e1521b3ba64e23e9271f8e192 (diff)
downloadrust-ffaf607cf2743f1206a739e02f7b194a4767f9a8.tar.gz
rust-ffaf607cf2743f1206a739e02f7b194a4767f9a8.zip
Remove `parse_negative_name_directive`
This isn't actually used for anything, and its presence complicates the
migration to `DirectiveLine`.
-rw-r--r--src/tools/compiletest/src/directives.rs18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/tools/compiletest/src/directives.rs b/src/tools/compiletest/src/directives.rs
index e864594ade2..01a663b016f 100644
--- a/src/tools/compiletest/src/directives.rs
+++ b/src/tools/compiletest/src/directives.rs
@@ -1117,10 +1117,6 @@ impl Config {
             && matches!(line.as_bytes().get(directive.len()), None | Some(&b' ') | Some(&b':'))
     }
 
-    fn parse_negative_name_directive(&self, line: &str, directive: &str) -> bool {
-        line.starts_with("no-") && self.parse_name_directive(&line[3..], directive)
-    }
-
     fn parse_name_value_directive(
         &self,
         line: &str,
@@ -1149,18 +1145,8 @@ impl Config {
     }
 
     fn set_name_directive(&self, line: &str, directive: &str, value: &mut bool) {
-        match value {
-            true => {
-                if self.parse_negative_name_directive(line, directive) {
-                    *value = false;
-                }
-            }
-            false => {
-                if self.parse_name_directive(line, directive) {
-                    *value = true;
-                }
-            }
-        }
+        // If the flag is already true, don't bother looking at the directive.
+        *value = *value || self.parse_name_directive(line, directive);
     }
 
     fn set_name_value_directive<T>(