Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,21 @@ impl<'test> TestCx<'test> {
prefix = self.error_prefix(),
n = not_found.len(),
);

// FIXME: Ideally, we should check this at the place where we actually parse error annotations.
// it's better to use (negated) heuristic inside normalize_output if possible
if let Some(human_format) = self.props.compile_flags.iter().find(|flag| {
// `human`, `human-unicode`, `short` will not generate JSON output
flag.contains("error-format")
&& (flag.contains("short") || flag.contains("human"))
}) {
let msg = format!(
"tests with compile flag `{}` should not have error annotations such as `//~ ERROR`",
human_format
).color(Color::Red);
writeln!(self.stdout, "{}", msg);
}

for error in &not_found {
print_error(error);
let mut suggestions = Vec::new();
Expand Down
Loading