about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLukas Wirth <lukastw97@gmail.com>2023-09-06 18:22:35 +0200
committerLukas Wirth <lukastw97@gmail.com>2023-09-06 18:31:16 +0200
commit3fa0bf0dd3f9749e1d98a9d5a43decf1a03d0331 (patch)
tree0fa7bd10ad2c37fbd4b8729ecefdd6303095ea1d
parentc0e402637eeff7dea29082f983f26be4ef2e317c (diff)
downloadrust-3fa0bf0dd3f9749e1d98a9d5a43decf1a03d0331.tar.gz
rust-3fa0bf0dd3f9749e1d98a9d5a43decf1a03d0331.zip
Fix ide-diagnostics test fixture
-rw-r--r--crates/ide-diagnostics/src/handlers/macro_error.rs6
-rw-r--r--crates/parser/test_data/parser/inline/ok/0207_builtin_expr.rast45
2 files changed, 46 insertions, 5 deletions
diff --git a/crates/ide-diagnostics/src/handlers/macro_error.rs b/crates/ide-diagnostics/src/handlers/macro_error.rs
index f54cdd63bbb..7ca0a0eab2b 100644
--- a/crates/ide-diagnostics/src/handlers/macro_error.rs
+++ b/crates/ide-diagnostics/src/handlers/macro_error.rs
@@ -157,6 +157,7 @@ struct S;
     fn macro_diag_builtin() {
         check_diagnostics(
             r#"
+//- minicore: fmt
 #[rustc_builtin_macro]
 macro_rules! env {}
 
@@ -166,9 +167,6 @@ macro_rules! include {}
 #[rustc_builtin_macro]
 macro_rules! compile_error {}
 
-#[rustc_builtin_macro]
-macro_rules! format_args { () => {} }
-
 fn main() {
     // Test a handful of built-in (eager) macros:
 
@@ -189,7 +187,7 @@ fn main() {
     // Lazy:
 
     format_args!();
-  //^^^^^^^^^^^ error: no rule matches input tokens
+  //^^^^^^^^^^^ error: Syntax Error in Expansion: expected expression
 }
 "#,
         );
diff --git a/crates/parser/test_data/parser/inline/ok/0207_builtin_expr.rast b/crates/parser/test_data/parser/inline/ok/0207_builtin_expr.rast
index f127b3e8c89..361900b6d3e 100644
--- a/crates/parser/test_data/parser/inline/ok/0207_builtin_expr.rast
+++ b/crates/parser/test_data/parser/inline/ok/0207_builtin_expr.rast
@@ -30,7 +30,50 @@ SOURCE_FILE
             FORMAT_ARGS_KW "format_args"
             L_PAREN "("
             LITERAL
-              INT_NUMBER "0"
+              STRING "\"\""
+            COMMA ","
+            WHITESPACE " "
+            FORMAT_ARGS_ARG
+              LITERAL
+                INT_NUMBER "0"
+            COMMA ","
+            WHITESPACE " "
+            FORMAT_ARGS_ARG
+              LITERAL
+                INT_NUMBER "1"
+            COMMA ","
+            WHITESPACE " "
+            FORMAT_ARGS_ARG
+              NAME
+                IDENT "a"
+              WHITESPACE " "
+              EQ "="
+              WHITESPACE " "
+              BIN_EXPR
+                LITERAL
+                  INT_NUMBER "2"
+                WHITESPACE " "
+                PLUS "+"
+                WHITESPACE " "
+                LITERAL
+                  INT_NUMBER "3"
+            COMMA ","
+            WHITESPACE " "
+            FORMAT_ARGS_ARG
+              BIN_EXPR
+                PATH_EXPR
+                  PATH
+                    PATH_SEGMENT
+                      NAME_REF
+                        IDENT "a"
+                WHITESPACE " "
+                PLUS "+"
+                WHITESPACE " "
+                PATH_EXPR
+                  PATH
+                    PATH_SEGMENT
+                      NAME_REF
+                        IDENT "b"
             R_PAREN ")"
           SEMICOLON ";"
         WHITESPACE "\n    "