Skip to content

Commit 3fa0bf0

Browse files
committed
Fix ide-diagnostics test fixture
1 parent c0e4026 commit 3fa0bf0

File tree

2 files changed

+46
-5
lines changed

2 files changed

+46
-5
lines changed

crates/ide-diagnostics/src/handlers/macro_error.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ struct S;
157157
fn macro_diag_builtin() {
158158
check_diagnostics(
159159
r#"
160+
//- minicore: fmt
160161
#[rustc_builtin_macro]
161162
macro_rules! env {}
162163
@@ -166,9 +167,6 @@ macro_rules! include {}
166167
#[rustc_builtin_macro]
167168
macro_rules! compile_error {}
168169
169-
#[rustc_builtin_macro]
170-
macro_rules! format_args { () => {} }
171-
172170
fn main() {
173171
// Test a handful of built-in (eager) macros:
174172
@@ -189,7 +187,7 @@ fn main() {
189187
// Lazy:
190188
191189
format_args!();
192-
//^^^^^^^^^^^ error: no rule matches input tokens
190+
//^^^^^^^^^^^ error: Syntax Error in Expansion: expected expression
193191
}
194192
"#,
195193
);

crates/parser/test_data/parser/inline/ok/0207_builtin_expr.rast

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,50 @@ SOURCE_FILE
3030
FORMAT_ARGS_KW "format_args"
3131
L_PAREN "("
3232
LITERAL
33-
INT_NUMBER "0"
33+
STRING "\"\""
34+
COMMA ","
35+
WHITESPACE " "
36+
FORMAT_ARGS_ARG
37+
LITERAL
38+
INT_NUMBER "0"
39+
COMMA ","
40+
WHITESPACE " "
41+
FORMAT_ARGS_ARG
42+
LITERAL
43+
INT_NUMBER "1"
44+
COMMA ","
45+
WHITESPACE " "
46+
FORMAT_ARGS_ARG
47+
NAME
48+
IDENT "a"
49+
WHITESPACE " "
50+
EQ "="
51+
WHITESPACE " "
52+
BIN_EXPR
53+
LITERAL
54+
INT_NUMBER "2"
55+
WHITESPACE " "
56+
PLUS "+"
57+
WHITESPACE " "
58+
LITERAL
59+
INT_NUMBER "3"
60+
COMMA ","
61+
WHITESPACE " "
62+
FORMAT_ARGS_ARG
63+
BIN_EXPR
64+
PATH_EXPR
65+
PATH
66+
PATH_SEGMENT
67+
NAME_REF
68+
IDENT "a"
69+
WHITESPACE " "
70+
PLUS "+"
71+
WHITESPACE " "
72+
PATH_EXPR
73+
PATH
74+
PATH_SEGMENT
75+
NAME_REF
76+
IDENT "b"
3477
R_PAREN ")"
3578
SEMICOLON ";"
3679
WHITESPACE "\n "

0 commit comments

Comments
 (0)