compiletest expects that a name-value directive, like //@ revisions: foo, to have the colon :
|
pub fn parse_name_value_directive(&self, line: &str, directive: &str) -> Option<String> { |
|
let colon = directive.len(); |
|
if line.starts_with(directive) && line.as_bytes().get(colon) == Some(&b':') { |
|
let value = line[(colon + 1)..].to_owned(); |
|
debug!("{}: {}", directive, value); |
|
Some(expand_variables(value, self)) |
|
} else { |
|
None |
|
} |
|
} |
If the name-value directive contains a known directive name like revisions but does not have the colon (i.e. //@ revisions foo), then:
- compiletest known directive check accepts the known directive name
revisions
parse_name_value_directive expects revisions: but only got revisions, so parsing fails
- no other compiletest directive parsing rules accept
revisions directive name
- no errors raised yet there is no effect (no revisions in this example).
compiletest should not silently fail here because it's very surprising and a pain to debug unless you know exactly what's wrong.
compiletest expects that a name-value directive, like
//@ revisions: foo, to have the colon:rust/src/tools/compiletest/src/header.rs
Lines 1137 to 1146 in b14d8b2
If the name-value directive contains a known directive name like
revisionsbut does not have the colon (i.e.//@ revisions foo), then:revisionsparse_name_value_directiveexpectsrevisions:but only gotrevisions, so parsing failsrevisionsdirective namecompiletest should not silently fail here because it's very surprising and a pain to debug unless you know exactly what's wrong.