diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2025-09-30 12:20:42 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2025-09-30 12:37:46 +1000 |
| commit | ffaf607cf2743f1206a739e02f7b194a4767f9a8 (patch) | |
| tree | 9c493ff255d0c174bed2fcad636c56e42d3677b1 | |
| parent | 505a2084e683662e1521b3ba64e23e9271f8e192 (diff) | |
| download | rust-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.rs | 18 |
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>( |
