diff --git a/src/test/parser.rs b/src/test/parser.rs index 903d4e48625..d86c172192d 100644 --- a/src/test/parser.rs +++ b/src/test/parser.rs @@ -69,3 +69,10 @@ fn crate_parsing_stashed_diag2() { let filename = "tests/parser/stashed-diag2.rs"; assert_parser_error(filename); } + +#[test] +fn parser_error_const_missing_type() { + // See also https://github.com/rust-lang/rustfmt/issues/6099 + let filename = "tests/parser/issue-6099.rs"; + assert_parser_error(filename); +} diff --git a/tests/parser/issue-6099.rs b/tests/parser/issue-6099.rs new file mode 100644 index 00000000000..8de0f36b079 --- /dev/null +++ b/tests/parser/issue-6099.rs @@ -0,0 +1 @@ +const BAR = 42; \ No newline at end of file