Skip to content

Commit 5c04ed2

Browse files
committed
Fix header parsing somewhat
previously it just errored on any comment It still errors on `//[thing]` style comments
1 parent 945daf2 commit 5c04ed2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/tools/compiletest/src/header.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -697,14 +697,15 @@ fn iter_header_extra(
697697
// First try to accept `ui_test` style comments
698698
} else if let Some((lncfg, ln)) = line_directive(comment, ln) {
699699
it(lncfg, ln, line_number);
700-
} else if mode == Mode::Ui && line_directive("//", ln).is_some() {
700+
} else if mode == Mode::Ui && matches!(line_directive("//", ln), Some((Some(_), _))) {
701701
// We have a comment that's *successfully* parsed as an legacy-style directive.
702702
// We emit an error here to warn the user.
703703
*poisoned = true;
704704
eprintln!(
705-
"error: detected legacy-style directives in ui test: {}:{}, please use `ui_test`-style directives `//@` instead",
705+
"error: detected legacy-style directives in ui test: {}:{}, please use `ui_test`-style directives `//@` instead:{:#?}",
706706
testfile.display(),
707707
line_number,
708+
line_directive("//", ln),
708709
);
709710
return;
710711
}

0 commit comments

Comments
 (0)