]> git.lizzy.rs Git - rust.git/blobdiff - crates/hir_def/src/macro_expansion_tests.rs
internal: make sure macro test expand to valid syntax
[rust.git] / crates / hir_def / src / macro_expansion_tests.rs
index 0a9ab9315727485693ad023bddac3d0653fb4e04..d96af5c40701c37d118e1ea9c5de1ea02e991c1b 100644 (file)
@@ -65,6 +65,11 @@ fn check(ra_fixture: &str, mut expect: Expect) {
             format_to!(expn_text, "/* error: {} */", err);
         }
         if let Some((parse, _token_map)) = exp.value {
+            assert!(
+                parse.errors().is_empty(),
+                "parse errors in expansion: \n{:#?}",
+                parse.errors()
+            );
             let pp = pretty_print_macro_expansion(parse.syntax_node());
             let indent = IndentLevel::from_node(call.syntax());
             let pp = reindent(indent, pp);