-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
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
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
expectsrevisions:
but only gotrevisions
, 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.
fmease
Metadata
Metadata
Assignees
Labels
A-compiletestArea: The compiletest test runnerArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.