From 9ad0c737ae7d55a41e6c5ec81c70193c181f2336 Mon Sep 17 00:00:00 2001 From: shulaoda <165626830+shulaoda@users.noreply.github.com> Date: Fri, 10 Oct 2025 18:09:53 +0800 Subject: [PATCH] Add test case for issue#6099 --- src/test/parser.rs | 7 +++++++ tests/parser/issue-6099.rs | 1 + 2 files changed, 8 insertions(+) create mode 100644 tests/parser/issue-6099.rs 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