Skip to content

Commit 36cf48b

Browse files
committed
Don't allow error annotations in known-bug tests
1 parent 5aae654 commit 36cf48b

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/tools/compiletest/src/runtest.rs

+11-7
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,16 @@ impl<'test> TestCx<'test> {
12741274
self.fatal_proc_rec("process did not return an error status", proc_res);
12751275
}
12761276

1277+
if self.props.known_bug {
1278+
if !expected_errors.is_empty() {
1279+
self.fatal_proc_rec(
1280+
"`known_bug` tests should not have an expected errors",
1281+
proc_res,
1282+
);
1283+
}
1284+
return;
1285+
}
1286+
12771287
// On Windows, keep all '\' path separators to match the paths reported in the JSON output
12781288
// from the compiler
12791289
let os_file_name = self.testpaths.file.display().to_string();
@@ -1311,13 +1321,7 @@ impl<'test> TestCx<'test> {
13111321

13121322
None => {
13131323
// If the test is a known bug, don't require that the error is annotated
1314-
if !self.props.known_bug
1315-
&& self.is_unexpected_compiler_message(
1316-
actual_error,
1317-
expect_help,
1318-
expect_note,
1319-
)
1320-
{
1324+
if self.is_unexpected_compiler_message(actual_error, expect_help, expect_note) {
13211325
self.error(&format!(
13221326
"{}:{}: unexpected {}: '{}'",
13231327
file_name,

0 commit comments

Comments
 (0)