From bc2550b196fbf341ce0168f7dda5498e4d7aaf63 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Tue, 28 May 2019 16:59:22 +0300
Subject: update tests

---
 crates/ra_syntax/tests/test.rs | 25 ++++++++++---------------
 1 file changed, 10 insertions(+), 15 deletions(-)

(limited to 'crates/ra_syntax/tests')

diff --git a/crates/ra_syntax/tests/test.rs b/crates/ra_syntax/tests/test.rs
index 91799f8b5..4b711f271 100644
--- a/crates/ra_syntax/tests/test.rs
+++ b/crates/ra_syntax/tests/test.rs
@@ -8,7 +8,7 @@ use std::{
 };
 
 use test_utils::{project_dir, dir_tests, read_text, collect_tests};
-use ra_syntax::{SourceFile, AstNode, fuzz};
+use ra_syntax::{SourceFile, fuzz};
 
 #[test]
 fn lexer_tests() {
@@ -21,26 +21,21 @@ fn lexer_tests() {
 #[test]
 fn parser_tests() {
     dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| {
-        let file = SourceFile::parse(text);
-        let errors = file.errors();
+        let parse = SourceFile::parse2(text);
+        let errors = parse.errors.as_slice();
         assert_eq!(
-            &*errors,
+            errors,
             &[] as &[ra_syntax::SyntaxError],
             "There should be no errors in the file {:?}",
-            path.display()
+            path.display(),
         );
-        file.syntax().debug_dump()
+        parse.debug_dump()
     });
     dir_tests(&test_data_dir(), &["parser/err", "parser/inline/err"], |text, path| {
-        let file = SourceFile::parse(text);
-        let errors = file.errors();
-        assert_ne!(
-            &*errors,
-            &[] as &[ra_syntax::SyntaxError],
-            "There should be errors in the file {:?}",
-            path.display()
-        );
-        file.syntax().debug_dump()
+        let parse = SourceFile::parse2(text);
+        let errors = parse.errors.as_slice();
+        assert!(!errors.is_empty(), "There should be errors in the file {:?}", path.display());
+        parse.debug_dump()
     });
 }
 
-- 
cgit v1.2.3


From 310bfe57bd1ea3cd5e22d434ae9d709265af5463 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Tue, 28 May 2019 17:09:45 +0300
Subject: update test data

---
 .../parser/err/0000_struct_field_missing_comma.txt |   2 +-
 .../data/parser/err/0001_item_recovery_in_file.txt |   4 +-
 .../data/parser/err/0002_duplicate_shebang.txt     |   2 +-
 .../tests/data/parser/err/0003_C++_semicolon.txt   |   4 +-
 .../data/parser/err/0004_use_path_bad_segment.txt  |   2 +-
 .../data/parser/err/0005_attribute_recover.txt     |   6 +-
 .../data/parser/err/0006_named_field_recovery.txt  |  16 +--
 .../data/parser/err/0007_stray_curly_in_file.txt   |   6 +-
 .../data/parser/err/0008_item_block_recovery.txt   |   6 +-
 .../err/0009_broken_struct_type_parameter.txt      |  22 ++--
 .../data/parser/err/0010_unsafe_lambda_block.txt   |   2 +-
 .../tests/data/parser/err/0011_extern_struct.txt   |   2 +-
 .../tests/data/parser/err/0013_invalid_type.txt    |  36 +++---
 .../tests/data/parser/err/0014_where_no_bounds.txt |   2 +-
 .../tests/data/parser/err/0015_curly_in_params.txt |  12 +-
 .../tests/data/parser/err/0016_missing_semi.txt    |   2 +-
 .../data/parser/err/0017_incomplete_binexpr.txt    |   2 +-
 .../tests/data/parser/err/0018_incomplete_fn.txt   |  10 +-
 .../tests/data/parser/err/0019_let_recover.txt     |  20 +--
 .../tests/data/parser/err/0020_fn_recover.txt      |   6 +-
 .../data/parser/err/0021_incomplete_param.txt      |   4 +-
 .../tests/data/parser/err/0022_bad_exprs.txt       |  78 ++++++------
 .../data/parser/err/0023_mismatched_paren.txt      |   4 +-
 .../data/parser/err/0024_many_type_parens.txt      |  62 +++++-----
 .../ra_syntax/tests/data/parser/err/0025_nope.txt  |  22 ++--
 .../tests/data/parser/err/0026_imp_recovery.txt    |   4 +-
 .../data/parser/err/0027_incomplere_where_for.txt  |   4 +-
 .../tests/data/parser/err/0028_macro_2.0.txt       | 134 ++++++++++-----------
 .../data/parser/err/0029_field_completion.txt      |   2 +-
 .../tests/data/parser/err/0030_string_suffixes.txt |   2 +-
 .../data/parser/err/0031_block_inner_attrs.txt     |   8 +-
 .../parser/err/0032_match_arms_inner_attrs.txt     |  22 ++--
 .../parser/err/0033_match_arms_outer_attrs.txt     |   6 +-
 .../inline/err/0001_array_type_missing_semi.txt    |  10 +-
 .../parser/inline/err/0002_misplaced_label_err.txt |   8 +-
 .../inline/err/0003_pointer_type_no_mutability.txt |   2 +-
 .../data/parser/inline/err/0004_impl_type.txt      |   8 +-
 .../inline/err/0005_fn_pointer_type_missing_fn.txt |  10 +-
 .../parser/inline/err/0006_unsafe_block_in_mod.txt |   4 +-
 .../inline/err/0007_async_without_semicolon.txt    |   2 +-
 .../tests/data/parser/inline/err/0008_pub_expr.txt |   2 +-
 .../inline/err/0009_attr_on_expr_not_allowed.txt   |   4 +-
 .../inline/err/0010_bad_tuple_index_expr.txt       |   6 +-
 .../parser/inline/err/0010_wrong_order_fns.txt     |   4 +-
 44 files changed, 288 insertions(+), 288 deletions(-)

(limited to 'crates/ra_syntax/tests')

diff --git a/crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.txt b/crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.txt
index 21ef31ba8..0662052c5 100644
--- a/crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0000_struct_field_missing_comma.txt
@@ -18,7 +18,6 @@ SOURCE_FILE@[0; 34)
             PATH_SEGMENT@[18; 21)
               NAME_REF@[18; 21)
                 IDENT@[18; 21) "u32"
-                err: `expected COMMA`
       WHITESPACE@[21; 26) "\n    "
       NAMED_FIELD_DEF@[26; 32)
         NAME@[26; 27)
@@ -32,3 +31,4 @@ SOURCE_FILE@[0; 34)
                 IDENT@[29; 32) "u32"
       WHITESPACE@[32; 33) "\n"
       R_CURLY@[33; 34) "}"
+err: `expected COMMA`
diff --git a/crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.txt b/crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.txt
index d7762c089..45044fe0a 100644
--- a/crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0001_item_recovery_in_file.txt
@@ -1,9 +1,7 @@
 SOURCE_FILE@[0; 21)
   ERROR@[0; 2)
     IF_KW@[0; 2) "if"
-    err: `expected an item`
   WHITESPACE@[2; 3) " "
-  err: `expected an item`
   ERROR@[3; 8)
     MATCH_KW@[3; 8) "match"
   WHITESPACE@[8; 10) "\n\n"
@@ -16,3 +14,5 @@ SOURCE_FILE@[0; 21)
     NAMED_FIELD_DEF_LIST@[19; 21)
       L_CURLY@[19; 20) "{"
       R_CURLY@[20; 21) "}"
+err: `expected an item`
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.txt b/crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.txt
index 76642f43b..1506acdfd 100644
--- a/crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0002_duplicate_shebang.txt
@@ -1,7 +1,7 @@
 SOURCE_FILE@[0; 42)
   SHEBANG@[0; 20) "#!/use/bin/env rusti"
   WHITESPACE@[20; 21) "\n"
-  err: `expected an item`
   ERROR@[21; 41)
     SHEBANG@[21; 41) "#!/use/bin/env rusti"
   WHITESPACE@[41; 42) "\n"
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.txt b/crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.txt
index b52aaa368..586baf1bb 100644
--- a/crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0003_C++_semicolon.txt
@@ -33,7 +33,7 @@ SOURCE_FILE@[0; 40)
       COMMA@[36; 37) ","
       WHITESPACE@[37; 38) "\n"
       R_CURLY@[38; 39) "}"
-      err: `expected item, found `;`
-consider removing this semicolon`
   ERROR@[39; 40)
     SEMI@[39; 40) ";"
+err: `expected item, found `;`
+consider removing this semicolon`
diff --git a/crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.txt b/crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.txt
index fb44f21ea..a70223912 100644
--- a/crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0004_use_path_bad_segment.txt
@@ -9,8 +9,8 @@ SOURCE_FILE@[0; 12)
             NAME_REF@[4; 7)
               IDENT@[4; 7) "foo"
         COLONCOLON@[7; 9) "::"
-        err: `expected identifier`
         PATH_SEGMENT@[9; 11)
           ERROR@[9; 11)
             INT_NUMBER@[9; 11) "92"
     SEMI@[11; 12) ";"
+err: `expected identifier`
diff --git a/crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.txt b/crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.txt
index 1e27522bf..9a6da88fe 100644
--- a/crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0005_attribute_recover.txt
@@ -49,7 +49,7 @@ SOURCE_FILE@[0; 54)
           L_CURLY@[50; 51) "{"
           WHITESPACE@[51; 52) "\n"
           R_CURLY@[52; 53) "}"
-          err: `expected R_PAREN`
-          err: `expected R_BRACK`
-          err: `expected an item`
   WHITESPACE@[53; 54) "\n"
+err: `expected R_PAREN`
+err: `expected R_BRACK`
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.txt b/crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.txt
index d47b98ed4..5effbb60f 100644
--- a/crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0006_named_field_recovery.txt
@@ -23,25 +23,17 @@ SOURCE_FILE@[0; 74)
       VISIBILITY@[27; 30)
         PUB_KW@[27; 30) "pub"
       WHITESPACE@[30; 31) " "
-      err: `expected field declaration`
       ERROR@[31; 33)
         INT_NUMBER@[31; 33) "92"
-        err: `expected COMMA`
       WHITESPACE@[33; 38) "\n    "
-      err: `expected field declaration`
       ERROR@[38; 39)
         PLUS@[38; 39) "+"
-        err: `expected COMMA`
       WHITESPACE@[39; 40) " "
-      err: `expected field declaration`
       ERROR@[40; 41)
         MINUS@[40; 41) "-"
-        err: `expected COMMA`
       WHITESPACE@[41; 42) " "
-      err: `expected field declaration`
       ERROR@[42; 43)
         STAR@[42; 43) "*"
-        err: `expected COMMA`
       WHITESPACE@[43; 48) "\n    "
       NAMED_FIELD_DEF@[48; 58)
         VISIBILITY@[48; 51)
@@ -72,3 +64,11 @@ SOURCE_FILE@[0; 74)
       WHITESPACE@[71; 72) "\n"
       R_CURLY@[72; 73) "}"
   WHITESPACE@[73; 74) "\n"
+err: `expected field declaration`
+err: `expected COMMA`
+err: `expected field declaration`
+err: `expected COMMA`
+err: `expected field declaration`
+err: `expected COMMA`
+err: `expected field declaration`
+err: `expected COMMA`
diff --git a/crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.txt b/crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.txt
index 94066ed05..ff59f5d71 100644
--- a/crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0007_stray_curly_in_file.txt
@@ -1,7 +1,6 @@
 SOURCE_FILE@[0; 31)
   ERROR@[0; 1)
     R_CURLY@[0; 1) "}"
-    err: `unmatched `}``
   WHITESPACE@[1; 3) "\n\n"
   STRUCT_DEF@[3; 12)
     STRUCT_KW@[3; 9) "struct"
@@ -10,7 +9,6 @@ SOURCE_FILE@[0; 31)
       IDENT@[10; 11) "S"
     SEMI@[11; 12) ";"
   WHITESPACE@[12; 14) "\n\n"
-  err: `unmatched `}``
   ERROR@[14; 15)
     R_CURLY@[14; 15) "}"
   WHITESPACE@[15; 17) "\n\n"
@@ -26,7 +24,9 @@ SOURCE_FILE@[0; 31)
       L_CURLY@[25; 26) "{"
       R_CURLY@[26; 27) "}"
   WHITESPACE@[27; 29) "\n\n"
-  err: `unmatched `}``
   ERROR@[29; 30)
     R_CURLY@[29; 30) "}"
   WHITESPACE@[30; 31) "\n"
+err: `unmatched `}``
+err: `unmatched `}``
+err: `unmatched `}``
diff --git a/crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.txt b/crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.txt
index 6f5a27856..75f6b3b9c 100644
--- a/crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0008_item_block_recovery.txt
@@ -18,13 +18,10 @@ SOURCE_FILE@[0; 95)
       PATH_SEGMENT@[14; 17)
         NAME_REF@[14; 17)
           IDENT@[14; 17) "bar"
-          err: `expected EXCL`
     TOKEN_TREE@[17; 19)
       L_PAREN@[17; 18) "("
       R_PAREN@[18; 19) ")"
-      err: `expected SEMI`
   WHITESPACE@[19; 20) " "
-  err: `expected an item`
   ERROR@[20; 80)
     L_CURLY@[20; 21) "{"
     WHITESPACE@[21; 26) "\n    "
@@ -75,3 +72,6 @@ SOURCE_FILE@[0; 95)
       WHITESPACE@[92; 93) "\n"
       R_CURLY@[93; 94) "}"
   WHITESPACE@[94; 95) "\n"
+err: `expected EXCL`
+err: `expected SEMI`
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.txt b/crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.txt
index 80568b5bd..8aa8c3ef4 100644
--- a/crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0009_broken_struct_type_parameter.txt
@@ -6,25 +6,17 @@ SOURCE_FILE@[0; 43)
       IDENT@[7; 8) "S"
     TYPE_PARAM_LIST@[8; 11)
       L_ANGLE@[8; 9) "<"
-      err: `expected type parameter`
       ERROR@[9; 11)
         INT_NUMBER@[9; 11) "90"
-        err: `expected COMMA`
-        err: `expected R_ANGLE`
-        err: `expected `;`, `{`, or `(``
   WHITESPACE@[11; 12) " "
-  err: `expected an item`
   ERROR@[12; 13)
     PLUS@[12; 13) "+"
   WHITESPACE@[13; 14) " "
-  err: `expected an item`
   ERROR@[14; 15)
     INT_NUMBER@[14; 15) "2"
-    err: `expected an item`
   ERROR@[15; 16)
     R_ANGLE@[15; 16) ">"
   WHITESPACE@[16; 17) " "
-  err: `expected an item`
   ERROR@[17; 31)
     L_CURLY@[17; 18) "{"
     WHITESPACE@[18; 23) "\n    "
@@ -34,12 +26,9 @@ SOURCE_FILE@[0; 43)
           PATH_SEGMENT@[23; 24)
             NAME_REF@[23; 24)
               IDENT@[23; 24) "f"
-              err: `expected SEMI`
-              err: `expected expression`
     EXPR_STMT@[24; 25)
       ERROR@[24; 25)
         COLON@[24; 25) ":"
-        err: `expected SEMI`
     WHITESPACE@[25; 26) " "
     PATH_EXPR@[26; 29)
       PATH@[26; 29)
@@ -56,3 +45,14 @@ SOURCE_FILE@[0; 43)
       IDENT@[40; 41) "T"
     SEMI@[41; 42) ";"
   WHITESPACE@[42; 43) "\n"
+err: `expected type parameter`
+err: `expected COMMA`
+err: `expected R_ANGLE`
+err: `expected `;`, `{`, or `(``
+err: `expected an item`
+err: `expected an item`
+err: `expected an item`
+err: `expected an item`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
diff --git a/crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.txt b/crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.txt
index 36982085a..22a1727f0 100644
--- a/crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0010_unsafe_lambda_block.txt
@@ -23,7 +23,6 @@ SOURCE_FILE@[0; 42)
             TUPLE_TYPE@[22; 24)
               L_PAREN@[22; 23) "("
               R_PAREN@[23; 24) ")"
-              err: `expected `{``
           WHITESPACE@[24; 25) " "
           BLOCK_EXPR@[25; 38)
             UNSAFE_KW@[25; 31) "unsafe"
@@ -40,3 +39,4 @@ SOURCE_FILE@[0; 42)
       WHITESPACE@[39; 40) "\n"
       R_CURLY@[40; 41) "}"
   WHITESPACE@[41; 42) "\n"
+err: `expected `{``
diff --git a/crates/ra_syntax/tests/data/parser/err/0011_extern_struct.txt b/crates/ra_syntax/tests/data/parser/err/0011_extern_struct.txt
index 3fb0a77ef..ee2a29d9f 100644
--- a/crates/ra_syntax/tests/data/parser/err/0011_extern_struct.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0011_extern_struct.txt
@@ -2,7 +2,6 @@ SOURCE_FILE@[0; 19)
   ERROR@[0; 6)
     ABI@[0; 6)
       EXTERN_KW@[0; 6) "extern"
-      err: `expected fn, trait or impl`
   WHITESPACE@[6; 7) " "
   STRUCT_DEF@[7; 18)
     STRUCT_KW@[7; 13) "struct"
@@ -11,3 +10,4 @@ SOURCE_FILE@[0; 19)
       IDENT@[14; 17) "Foo"
     SEMI@[17; 18) ";"
   WHITESPACE@[18; 19) "\n"
+err: `expected fn, trait or impl`
diff --git a/crates/ra_syntax/tests/data/parser/err/0013_invalid_type.txt b/crates/ra_syntax/tests/data/parser/err/0013_invalid_type.txt
index 47b992b0a..1f5cc55c0 100644
--- a/crates/ra_syntax/tests/data/parser/err/0013_invalid_type.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0013_invalid_type.txt
@@ -43,17 +43,9 @@ SOURCE_FILE@[0; 86)
                                     IDENT@[63; 66) "Box"
                                   TYPE_ARG_LIST@[66; 68)
                                     L_ANGLE@[66; 67) "<"
-                                    err: `expected type`
                                     TYPE_ARG@[67; 68)
                                       ERROR@[67; 68)
                                         AT@[67; 68) "@"
-                                        err: `expected COMMA`
-                                        err: `expected R_ANGLE`
-                                        err: `expected COMMA`
-                                        err: `expected R_ANGLE`
-                                        err: `expected COMMA`
-                                        err: `expected R_ANGLE`
-                                        err: `expected COMMA`
       WHITESPACE@[68; 69) " "
       POS_FIELD_DEF@[69; 72)
         PATH_TYPE@[69; 72)
@@ -61,29 +53,37 @@ SOURCE_FILE@[0; 86)
             PATH_SEGMENT@[69; 72)
               NAME_REF@[69; 72)
                 IDENT@[69; 72) "Any"
-                err: `expected COMMA`
-                err: `expected a type`
-                err: `expected R_PAREN`
-                err: `expected SEMI`
-                err: `expected an item`
       ERROR@[72; 72)
   ERROR@[72; 73)
     R_ANGLE@[72; 73) ">"
-    err: `expected an item`
   ERROR@[73; 74)
     COMMA@[73; 74) ","
   WHITESPACE@[74; 79) "\n    "
-  err: `expected an item`
   ERROR@[79; 80)
     R_ANGLE@[79; 80) ">"
-    err: `expected an item`
   ERROR@[80; 81)
     R_ANGLE@[80; 81) ">"
   WHITESPACE@[81; 82) "\n"
-  err: `expected an item`
   ERROR@[82; 83)
     R_PAREN@[82; 83) ")"
-    err: `expected an item`
   ERROR@[83; 84)
     SEMI@[83; 84) ";"
   WHITESPACE@[84; 86) "\n\n"
+err: `expected type`
+err: `expected COMMA`
+err: `expected R_ANGLE`
+err: `expected COMMA`
+err: `expected R_ANGLE`
+err: `expected COMMA`
+err: `expected R_ANGLE`
+err: `expected COMMA`
+err: `expected COMMA`
+err: `expected a type`
+err: `expected R_PAREN`
+err: `expected SEMI`
+err: `expected an item`
+err: `expected an item`
+err: `expected an item`
+err: `expected an item`
+err: `expected an item`
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.txt b/crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.txt
index 52ad7bef7..276a58b69 100644
--- a/crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0014_where_no_bounds.txt
@@ -23,9 +23,9 @@ SOURCE_FILE@[0; 23)
             PATH_SEGMENT@[18; 19)
               NAME_REF@[18; 19)
                 IDENT@[18; 19) "T"
-                err: `expected colon`
     WHITESPACE@[19; 20) " "
     BLOCK@[20; 22)
       L_CURLY@[20; 21) "{"
       R_CURLY@[21; 22) "}"
   WHITESPACE@[22; 23) "\n"
+err: `expected colon`
diff --git a/crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.txt b/crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.txt
index 1350980f2..8f93b832d 100644
--- a/crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0015_curly_in_params.txt
@@ -6,19 +6,19 @@ SOURCE_FILE@[0; 14)
       IDENT@[3; 6) "foo"
     PARAM_LIST@[6; 7)
       L_PAREN@[6; 7) "("
-      err: `expected value parameter`
-      err: `expected R_PAREN`
-      err: `expected a block`
-      err: `unmatched `}``
   ERROR@[7; 8)
     R_CURLY@[7; 8) "}"
-    err: `expected an item`
   ERROR@[8; 9)
     R_PAREN@[8; 9) ")"
   WHITESPACE@[9; 10) " "
-  err: `expected an item`
   ERROR@[10; 13)
     L_CURLY@[10; 11) "{"
     WHITESPACE@[11; 12) "\n"
     R_CURLY@[12; 13) "}"
   WHITESPACE@[13; 14) "\n"
+err: `expected value parameter`
+err: `expected R_PAREN`
+err: `expected a block`
+err: `unmatched `}``
+err: `expected an item`
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/err/0016_missing_semi.txt b/crates/ra_syntax/tests/data/parser/err/0016_missing_semi.txt
index dd60814a0..105e45a35 100644
--- a/crates/ra_syntax/tests/data/parser/err/0016_missing_semi.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0016_missing_semi.txt
@@ -29,7 +29,6 @@ SOURCE_FILE@[0; 56)
               INT_NUMBER@[31; 32) "2"
             WHITESPACE@[32; 37) "\n    "
             R_PAREN@[37; 38) ")"
-            err: `expected SEMI`
       WHITESPACE@[38; 43) "\n    "
       EXPR_STMT@[43; 53)
         RETURN_EXPR@[43; 52)
@@ -41,3 +40,4 @@ SOURCE_FILE@[0; 56)
       WHITESPACE@[53; 54) "\n"
       R_CURLY@[54; 55) "}"
   WHITESPACE@[55; 56) "\n"
+err: `expected SEMI`
diff --git a/crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.txt b/crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.txt
index f115eb1dd..751740620 100644
--- a/crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0017_incomplete_binexpr.txt
@@ -40,7 +40,7 @@ SOURCE_FILE@[0; 47)
           INT_NUMBER@[41; 42) "1"
         WHITESPACE@[42; 43) " "
         PLUS@[43; 44) "+"
-        err: `expected expression`
       WHITESPACE@[44; 45) "\n"
       R_CURLY@[45; 46) "}"
   WHITESPACE@[46; 47) "\n"
+err: `expected expression`
diff --git a/crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.txt b/crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.txt
index 9996cf824..82908b8f2 100644
--- a/crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0018_incomplete_fn.txt
@@ -21,9 +21,6 @@ SOURCE_FILE@[0; 183)
           PARAM@[33; 34)
             REF_PAT@[33; 34)
               AMP@[33; 34) "&"
-              err: `expected pattern`
-              err: `expected COLON`
-              err: `expected type`
           R_PAREN@[34; 35) ")"
         WHITESPACE@[35; 36) " "
         RET_TYPE@[36; 46)
@@ -124,8 +121,11 @@ SOURCE_FILE@[0; 183)
         WHITESPACE@[169; 170) " "
         NAME@[170; 180)
           IDENT@[170; 180) "set_parent"
-          err: `expected function arguments`
-          err: `expected a block`
       WHITESPACE@[180; 181) "\n"
       R_CURLY@[181; 182) "}"
   WHITESPACE@[182; 183) "\n"
+err: `expected pattern`
+err: `expected COLON`
+err: `expected type`
+err: `expected function arguments`
+err: `expected a block`
diff --git a/crates/ra_syntax/tests/data/parser/err/0019_let_recover.txt b/crates/ra_syntax/tests/data/parser/err/0019_let_recover.txt
index c12649d5e..4a1b84ee5 100644
--- a/crates/ra_syntax/tests/data/parser/err/0019_let_recover.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0019_let_recover.txt
@@ -19,8 +19,6 @@ SOURCE_FILE@[0; 139)
             IDENT@[19; 22) "foo"
         WHITESPACE@[22; 23) " "
         EQ@[23; 24) "="
-        err: `expected expression`
-        err: `expected SEMI`
       WHITESPACE@[24; 29) "\n    "
       LET_STMT@[29; 41)
         LET_KW@[29; 32) "let"
@@ -37,8 +35,6 @@ SOURCE_FILE@[0; 139)
       WHITESPACE@[41; 46) "\n    "
       LET_STMT@[46; 49)
         LET_KW@[46; 49) "let"
-        err: `expected pattern`
-        err: `expected SEMI`
       WHITESPACE@[49; 54) "\n    "
       LET_STMT@[54; 67)
         LET_KW@[54; 57) "let"
@@ -55,8 +51,6 @@ SOURCE_FILE@[0; 139)
       WHITESPACE@[67; 72) "\n    "
       LET_STMT@[72; 75)
         LET_KW@[72; 75) "let"
-        err: `expected pattern`
-        err: `expected SEMI`
       WHITESPACE@[75; 80) "\n    "
       EXPR_STMT@[80; 90)
         IF_EXPR@[80; 90)
@@ -72,8 +66,6 @@ SOURCE_FILE@[0; 139)
       WHITESPACE@[90; 95) "\n    "
       LET_STMT@[95; 98)
         LET_KW@[95; 98) "let"
-        err: `expected pattern`
-        err: `expected SEMI`
       WHITESPACE@[98; 103) "\n    "
       EXPR_STMT@[103; 116)
         WHILE_EXPR@[103; 116)
@@ -89,8 +81,6 @@ SOURCE_FILE@[0; 139)
       WHITESPACE@[116; 121) "\n    "
       LET_STMT@[121; 124)
         LET_KW@[121; 124) "let"
-        err: `expected pattern`
-        err: `expected SEMI`
       WHITESPACE@[124; 129) "\n    "
       LOOP_EXPR@[129; 136)
         LOOP_KW@[129; 133) "loop"
@@ -101,3 +91,13 @@ SOURCE_FILE@[0; 139)
       WHITESPACE@[136; 137) "\n"
       R_CURLY@[137; 138) "}"
   WHITESPACE@[138; 139) "\n"
+err: `expected expression`
+err: `expected SEMI`
+err: `expected pattern`
+err: `expected SEMI`
+err: `expected pattern`
+err: `expected SEMI`
+err: `expected pattern`
+err: `expected SEMI`
+err: `expected pattern`
+err: `expected SEMI`
diff --git a/crates/ra_syntax/tests/data/parser/err/0020_fn_recover.txt b/crates/ra_syntax/tests/data/parser/err/0020_fn_recover.txt
index b48bd5dee..d7ac73afa 100644
--- a/crates/ra_syntax/tests/data/parser/err/0020_fn_recover.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0020_fn_recover.txt
@@ -1,9 +1,6 @@
 SOURCE_FILE@[0; 16)
   FN_DEF@[0; 2)
     FN_KW@[0; 2) "fn"
-    err: `expected a name`
-    err: `expected function arguments`
-    err: `expected a block`
   WHITESPACE@[2; 4) "\n\n"
   FN_DEF@[4; 15)
     FN_KW@[4; 6) "fn"
@@ -18,3 +15,6 @@ SOURCE_FILE@[0; 16)
       L_CURLY@[13; 14) "{"
       R_CURLY@[14; 15) "}"
   WHITESPACE@[15; 16) "\n"
+err: `expected a name`
+err: `expected function arguments`
+err: `expected a block`
diff --git a/crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.txt b/crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.txt
index 81b52c8ce..086224eee 100644
--- a/crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0021_incomplete_param.txt
@@ -23,8 +23,6 @@ SOURCE_FILE@[0; 22)
         BIND_PAT@[15; 16)
           NAME@[15; 16)
             IDENT@[15; 16) "y"
-            err: `expected COLON`
-            err: `expected type`
       R_PAREN@[16; 17) ")"
     WHITESPACE@[17; 18) " "
     BLOCK@[18; 21)
@@ -32,3 +30,5 @@ SOURCE_FILE@[0; 22)
       WHITESPACE@[19; 20) "\n"
       R_CURLY@[20; 21) "}"
   WHITESPACE@[21; 22) "\n"
+err: `expected COLON`
+err: `expected type`
diff --git a/crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.txt b/crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.txt
index 6dfdfc343..d7a5fa1d2 100644
--- a/crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0022_bad_exprs.txt
@@ -21,34 +21,23 @@ SOURCE_FILE@[0; 112)
           LITERAL@[13; 14)
             INT_NUMBER@[13; 14) "2"
           COMMA@[14; 15) ","
-          err: `expected expression`
-          err: `expected R_BRACK`
-          err: `expected SEMI`
       WHITESPACE@[15; 16) " "
-      err: `expected expression`
       EXPR_STMT@[16; 17)
         ERROR@[16; 17)
           AT@[16; 17) "@"
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[17; 18)
         ERROR@[17; 18)
           COMMA@[17; 18) ","
-          err: `expected SEMI`
       WHITESPACE@[18; 19) " "
       STRUCT_DEF@[19; 26)
         STRUCT_KW@[19; 25) "struct"
-        err: `expected a name`
         ERROR@[25; 26)
           COMMA@[25; 26) ","
-          err: `expected `;`, `{`, or `(``
       WHITESPACE@[26; 27) " "
       LET_STMT@[27; 31)
         LET_KW@[27; 30) "let"
-        err: `expected pattern`
         ERROR@[30; 31)
           R_BRACK@[30; 31) "]"
-          err: `expected SEMI`
       WHITESPACE@[31; 32) " "
       R_CURLY@[32; 33) "}"
   WHITESPACE@[33; 34) "\n"
@@ -80,35 +69,22 @@ SOURCE_FILE@[0; 112)
             LITERAL@[50; 51)
               INT_NUMBER@[50; 51) "2"
             COMMA@[51; 52) ","
-            err: `expected expression`
-            err: `expected SEMI`
       WHITESPACE@[52; 53) " "
-      err: `expected expression`
       EXPR_STMT@[53; 54)
         ERROR@[53; 54)
           AT@[53; 54) "@"
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[54; 55)
         ERROR@[54; 55)
           COMMA@[54; 55) ","
-          err: `expected SEMI`
       WHITESPACE@[55; 56) " "
       IMPL_BLOCK@[56; 60)
         IMPL_KW@[56; 60) "impl"
-        err: `expected type`
-        err: `expected `{``
-        err: `expected expression`
       EXPR_STMT@[60; 61)
         ERROR@[60; 61)
           COMMA@[60; 61) ","
-          err: `expected SEMI`
       WHITESPACE@[61; 62) " "
       LET_STMT@[62; 65)
         LET_KW@[62; 65) "let"
-        err: `expected pattern`
-        err: `expected SEMI`
-        err: `expected expression`
       ERROR@[65; 66)
         R_PAREN@[65; 66) ")"
       WHITESPACE@[66; 67) " "
@@ -145,45 +121,69 @@ SOURCE_FILE@[0; 112)
             LITERAL@[89; 90)
               INT_NUMBER@[89; 90) "2"
             COMMA@[90; 91) ","
-            err: `expected expression`
-            err: `expected SEMI`
       WHITESPACE@[91; 92) " "
-      err: `expected expression`
       EXPR_STMT@[92; 93)
         ERROR@[92; 93)
           AT@[92; 93) "@"
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[93; 94)
         ERROR@[93; 94)
           COMMA@[93; 94) ","
-          err: `expected SEMI`
       WHITESPACE@[94; 95) " "
-      err: `expected expression`
       EXPR_STMT@[95; 96)
         ERROR@[95; 96)
           R_BRACK@[95; 96) "]"
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[96; 97)
         ERROR@[96; 97)
           COMMA@[96; 97) ","
-          err: `expected SEMI`
       WHITESPACE@[97; 98) " "
       TRAIT_DEF@[98; 104)
         TRAIT_KW@[98; 103) "trait"
-        err: `expected a name`
         ERROR@[103; 104)
           COMMA@[103; 104) ","
-          err: `expected `{``
       WHITESPACE@[104; 105) " "
       LET_STMT@[105; 108)
         LET_KW@[105; 108) "let"
-        err: `expected pattern`
-        err: `expected SEMI`
-        err: `expected expression`
       ERROR@[108; 109)
         R_PAREN@[108; 109) ")"
       WHITESPACE@[109; 110) " "
       R_CURLY@[110; 111) "}"
   WHITESPACE@[111; 112) "\n"
+err: `expected expression`
+err: `expected R_BRACK`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected a name`
+err: `expected `;`, `{`, or `(``
+err: `expected pattern`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected type`
+err: `expected `{``
+err: `expected expression`
+err: `expected SEMI`
+err: `expected pattern`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected a name`
+err: `expected `{``
+err: `expected pattern`
+err: `expected SEMI`
+err: `expected expression`
diff --git a/crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.txt b/crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.txt
index 469d35082..143600e67 100644
--- a/crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0023_mismatched_paren.txt
@@ -31,13 +31,13 @@ SOURCE_FILE@[0; 94)
           COMMA@[44; 45) ","
           WHITESPACE@[45; 46) " "
           FLOAT_NUMBER@[46; 49) "2.0"
-          err: `unmatched `}``
       WHITESPACE@[49; 54) "\n    "
       R_CURLY@[54; 55) "}"
   WHITESPACE@[55; 56) " "
   COMMENT@[56; 91) "//~ ERROR incorrect c ..."
   WHITESPACE@[91; 92) "\n"
-  err: `unmatched `}``
   ERROR@[92; 93)
     R_CURLY@[92; 93) "}"
   WHITESPACE@[93; 94) "\n"
+err: `unmatched `}``
+err: `unmatched `}``
diff --git a/crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.txt b/crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.txt
index 0fb73d838..4f505fa76 100644
--- a/crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0024_many_type_parens.txt
@@ -103,8 +103,6 @@ SOURCE_FILE@[0; 240)
                                 NAME_REF@[83; 87)
                                   IDENT@[83; 87) "Copy"
                           R_PAREN@[87; 88) ")"
-                          err: `expected COMMA`
-                          err: `expected R_ANGLE`
             WHITESPACE@[88; 89) " "
             PLUS@[89; 90) "+"
             WHITESPACE@[90; 91) " "
@@ -141,8 +139,6 @@ SOURCE_FILE@[0; 240)
                           LIFETIME@[117; 119) "\'a"
                         R_ANGLE@[119; 120) ">"
               R_PAREN@[120; 121) ")"
-              err: `expected SEMI`
-              err: `expected expression`
       EXPR_STMT@[121; 123)
         ERROR@[121; 122)
           R_ANGLE@[121; 122) ">"
@@ -165,54 +161,35 @@ SOURCE_FILE@[0; 240)
                 TYPE_ARG@[139; 141)
                   PAREN_TYPE@[139; 141)
                     L_PAREN@[139; 140) "("
-                    err: `expected type`
                     ERROR@[140; 141)
                       QUESTION@[140; 141) "?"
-                      err: `expected R_PAREN`
-                      err: `expected COMMA`
-                      err: `expected R_ANGLE`
-                      err: `expected SEMI`
       EXPR_STMT@[141; 146)
         PATH_EXPR@[141; 146)
           PATH@[141; 146)
             PATH_SEGMENT@[141; 146)
               NAME_REF@[141; 146)
                 IDENT@[141; 146) "Sized"
-                err: `expected SEMI`
-                err: `expected expression`
       EXPR_STMT@[146; 147)
         ERROR@[146; 147)
           R_PAREN@[146; 147) ")"
-          err: `expected SEMI`
       WHITESPACE@[147; 148) " "
-      err: `expected expression`
       EXPR_STMT@[148; 149)
         ERROR@[148; 149)
           PLUS@[148; 149) "+"
-          err: `expected SEMI`
       WHITESPACE@[149; 150) " "
       EXPR_STMT@[150; 151)
         PAREN_EXPR@[150; 151)
           L_PAREN@[150; 151) "("
-          err: `expected expression`
-          err: `expected R_PAREN`
-          err: `expected SEMI`
       EXPR_STMT@[151; 157)
         FOR_EXPR@[151; 157)
           FOR_KW@[151; 154) "for"
-          err: `expected pattern`
           ERROR@[154; 155)
             L_ANGLE@[154; 155) "<"
-            err: `expected IN_KW`
-            err: `expected expression`
           ERROR@[155; 157)
             LIFETIME@[155; 157) "\'a"
-            err: `expected a block`
-            err: `expected expression`
       EXPR_STMT@[157; 158)
         ERROR@[157; 158)
           R_ANGLE@[157; 158) ">"
-          err: `expected SEMI`
       WHITESPACE@[158; 159) " "
       EXPR_STMT@[159; 180)
         BIN_EXPR@[159; 180)
@@ -225,11 +202,9 @@ SOURCE_FILE@[0; 240)
                       NAME_REF@[159; 164)
                         IDENT@[159; 164) "Trait"
                 L_ANGLE@[164; 165) "<"
-                err: `expected expression`
                 ERROR@[165; 167)
                   LIFETIME@[165; 167) "\'a"
               R_ANGLE@[167; 168) ">"
-              err: `expected expression`
               ERROR@[168; 169)
                 R_PAREN@[168; 169) ")"
             WHITESPACE@[169; 170) " "
@@ -244,10 +219,8 @@ SOURCE_FILE@[0; 240)
                       IDENT@[173; 177) "Copy"
               R_PAREN@[177; 178) ")"
           R_ANGLE@[178; 179) ">"
-          err: `expected expression`
           ERROR@[179; 180)
             SEMI@[179; 180) ";"
-            err: `expected SEMI`
       WHITESPACE@[180; 185) "\n    "
       LET_STMT@[185; 235)
         LET_KW@[185; 188) "let"
@@ -288,8 +261,6 @@ SOURCE_FILE@[0; 240)
                                       LIFETIME@[211; 213) "\'a"
                                     R_ANGLE@[213; 214) ">"
                           R_PAREN@[214; 215) ")"
-                          err: `expected COMMA`
-                          err: `expected R_ANGLE`
             WHITESPACE@[215; 216) " "
             PLUS@[216; 217) "+"
             WHITESPACE@[217; 218) " "
@@ -313,8 +284,6 @@ SOURCE_FILE@[0; 240)
                     NAME_REF@[229; 234)
                       IDENT@[229; 234) "Sized"
               R_PAREN@[234; 235) ")"
-              err: `expected SEMI`
-              err: `expected expression`
       EXPR_STMT@[235; 237)
         ERROR@[235; 236)
           R_ANGLE@[235; 236) ">"
@@ -322,3 +291,34 @@ SOURCE_FILE@[0; 240)
       WHITESPACE@[237; 238) "\n"
       R_CURLY@[238; 239) "}"
   WHITESPACE@[239; 240) "\n"
+err: `expected COMMA`
+err: `expected R_ANGLE`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected type`
+err: `expected R_PAREN`
+err: `expected COMMA`
+err: `expected R_ANGLE`
+err: `expected SEMI`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected R_PAREN`
+err: `expected SEMI`
+err: `expected pattern`
+err: `expected IN_KW`
+err: `expected expression`
+err: `expected a block`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected expression`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected COMMA`
+err: `expected R_ANGLE`
+err: `expected SEMI`
+err: `expected expression`
diff --git a/crates/ra_syntax/tests/data/parser/err/0025_nope.txt b/crates/ra_syntax/tests/data/parser/err/0025_nope.txt
index b8d769947..a1bd8647a 100644
--- a/crates/ra_syntax/tests/data/parser/err/0025_nope.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0025_nope.txt
@@ -50,14 +50,10 @@ SOURCE_FILE@[0; 575)
                 NAME@[91; 94)
                   IDENT@[91; 94) "abc"
                 COLON@[94; 95) ":"
-                err: `expected type`
-                err: `expected COMMA`
               WHITESPACE@[95; 96) " "
-              err: `expected field`
               ERROR@[96; 98)
                 L_CURLY@[96; 97) "{"
                 R_CURLY@[97; 98) "}"
-                err: `expected field declaration`
               ERROR@[98; 99)
                 COMMA@[98; 99) ","
               WHITESPACE@[99; 100) " "
@@ -159,17 +155,11 @@ SOURCE_FILE@[0; 575)
                           PATH_SEGMENT@[368; 371)
                             NAME_REF@[368; 371)
                               IDENT@[368; 371) "i32"
-                              err: `expected COMMA`
                     WHITESPACE@[371; 372) " "
-                    err: `expected a type`
-                    err: `expected R_PAREN`
-                    err: `expected COMMA`
-                    err: `expected enum variant`
                     ERROR@[372; 372)
                 ERROR@[372; 374)
                   L_CURLY@[372; 373) "{"
                   R_CURLY@[373; 374) "}"
-                  err: `expected enum variant`
                 ERROR@[374; 375)
                   R_PAREN@[374; 375) ")"
                 WHITESPACE@[375; 376) " "
@@ -192,7 +182,6 @@ SOURCE_FILE@[0; 575)
         WHITESPACE@[505; 506) " "
         EQ@[506; 507) "="
         WHITESPACE@[507; 508) " "
-        err: `expected expression`
         ERROR@[508; 509)
           UNDERSCORE@[508; 509) "_"
         SEMI@[509; 510) ";"
@@ -201,3 +190,14 @@ SOURCE_FILE@[0; 575)
       WHITESPACE@[572; 573) "\n"
       R_CURLY@[573; 574) "}"
   WHITESPACE@[574; 575) "\n"
+err: `expected type`
+err: `expected COMMA`
+err: `expected field`
+err: `expected field declaration`
+err: `expected COMMA`
+err: `expected a type`
+err: `expected R_PAREN`
+err: `expected COMMA`
+err: `expected enum variant`
+err: `expected enum variant`
+err: `expected expression`
diff --git a/crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.txt b/crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.txt
index cfd06c9c9..f473718dc 100644
--- a/crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0026_imp_recovery.txt
@@ -16,8 +16,6 @@ SOURCE_FILE@[0; 38)
                   NAME_REF@[8; 13)
                     IDENT@[8; 13) "Clone"
       R_ANGLE@[13; 14) ">"
-      err: `expected trait or type`
-      err: `expected `{``
   WHITESPACE@[14; 15) "\n"
   IMPL_BLOCK@[15; 37)
     IMPL_KW@[15; 19) "impl"
@@ -47,3 +45,5 @@ SOURCE_FILE@[0; 38)
       L_CURLY@[35; 36) "{"
       R_CURLY@[36; 37) "}"
   WHITESPACE@[37; 38) "\n"
+err: `expected trait or type`
+err: `expected `{``
diff --git a/crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.txt b/crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.txt
index c87c2c936..5a2b52d05 100644
--- a/crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0027_incomplere_where_for.txt
@@ -19,10 +19,10 @@ SOURCE_FILE@[0; 30)
             LIFETIME_PARAM@[23; 25)
               LIFETIME@[23; 25) "\'a"
             R_ANGLE@[25; 26) ">"
-            err: `expected a path`
-            err: `expected colon`
     WHITESPACE@[26; 27) "\n"
     BLOCK@[27; 29)
       L_CURLY@[27; 28) "{"
       R_CURLY@[28; 29) "}"
   WHITESPACE@[29; 30) "\n"
+err: `expected a path`
+err: `expected colon`
diff --git a/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt b/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt
index 97ec4a5ab..8a59a5ac3 100644
--- a/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0028_macro_2.0.txt
@@ -4,7 +4,6 @@ SOURCE_FILE@[0; 349)
       PATH_SEGMENT@[0; 5)
         NAME_REF@[0; 5)
           IDENT@[0; 5) "macro"
-          err: `expected EXCL`
     WHITESPACE@[5; 6) " "
     NAME@[6; 21)
       IDENT@[6; 21) "parse_use_trees"
@@ -28,9 +27,7 @@ SOURCE_FILE@[0; 349)
         R_PAREN@[38; 39) ")"
       STAR@[39; 40) "*"
       R_PAREN@[40; 41) ")"
-      err: `expected SEMI`
   WHITESPACE@[41; 42) " "
-  err: `expected an item`
   ERROR@[42; 93)
     L_CURLY@[42; 43) "{"
     WHITESPACE@[43; 48) "\n    "
@@ -85,7 +82,6 @@ SOURCE_FILE@[0; 349)
             PATH_SEGMENT@[134; 139)
               NAME_REF@[134; 139)
                 IDENT@[134; 139) "macro"
-                err: `expected SEMI`
       WHITESPACE@[139; 140) " "
       EXPR_STMT@[140; 154)
         CALL_EXPR@[140; 154)
@@ -98,175 +94,112 @@ SOURCE_FILE@[0; 349)
             L_PAREN@[150; 151) "("
             ARRAY_EXPR@[151; 154)
               L_BRACK@[151; 152) "["
-              err: `expected expression`
               ERROR@[152; 153)
                 DOLLAR@[152; 153) "$"
-                err: `expected COMMA`
               PAREN_EXPR@[153; 154)
                 L_PAREN@[153; 154) "("
-                err: `expected expression`
-                err: `expected R_PAREN`
-                err: `expected COMMA`
-                err: `expected expression`
-                err: `expected R_BRACK`
-                err: `expected COMMA`
-                err: `expected SEMI`
-                err: `expected expression`
       EXPR_STMT@[154; 155)
         ERROR@[154; 155)
           DOLLAR@[154; 155) "$"
-          err: `expected SEMI`
       EXPR_STMT@[155; 160)
         PATH_EXPR@[155; 160)
           PATH@[155; 160)
             PATH_SEGMENT@[155; 160)
               NAME_REF@[155; 160)
                 IDENT@[155; 160) "input"
-                err: `expected SEMI`
-                err: `expected expression`
       EXPR_STMT@[160; 161)
         ERROR@[160; 161)
           COLON@[160; 161) ":"
-          err: `expected SEMI`
       EXPR_STMT@[161; 165)
         PATH_EXPR@[161; 165)
           PATH@[161; 165)
             PATH_SEGMENT@[161; 165)
               NAME_REF@[161; 165)
                 IDENT@[161; 165) "expr"
-                err: `expected SEMI`
-                err: `expected expression`
       EXPR_STMT@[165; 166)
         ERROR@[165; 166)
           R_PAREN@[165; 166) ")"
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[166; 167)
         ERROR@[166; 167)
           COMMA@[166; 167) ","
-          err: `expected SEMI`
       EXPR_STMT@[167; 170)
         PREFIX_EXPR@[167; 170)
           STAR@[167; 168) "*"
           WHITESPACE@[168; 169) " "
-          err: `expected expression`
           ERROR@[169; 170)
             DOLLAR@[169; 170) "$"
-            err: `expected SEMI`
       EXPR_STMT@[170; 171)
         PAREN_EXPR@[170; 171)
           L_PAREN@[170; 171) "("
-          err: `expected expression`
-          err: `expected R_PAREN`
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[171; 172)
         ERROR@[171; 172)
           COMMA@[171; 172) ","
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[172; 173)
         ERROR@[172; 173)
           R_PAREN@[172; 173) ")"
-          err: `expected SEMI`
       EXPR_STMT@[173; 175)
         PREFIX_EXPR@[173; 175)
           STAR@[173; 174) "*"
-          err: `expected expression`
           ERROR@[174; 175)
             R_BRACK@[174; 175) "]"
-            err: `expected SEMI`
-            err: `expected expression`
       EXPR_STMT@[175; 176)
         ERROR@[175; 176)
           COMMA@[175; 176) ","
-          err: `expected SEMI`
       WHITESPACE@[176; 177) " "
       EXPR_STMT@[177; 180)
         ARRAY_EXPR@[177; 180)
           L_BRACK@[177; 178) "["
-          err: `expected expression`
           ERROR@[178; 179)
             DOLLAR@[178; 179) "$"
-            err: `expected COMMA`
           PAREN_EXPR@[179; 180)
             L_PAREN@[179; 180) "("
-            err: `expected expression`
-            err: `expected R_PAREN`
-            err: `expected COMMA`
-            err: `expected expression`
-            err: `expected R_BRACK`
-            err: `expected SEMI`
-            err: `expected expression`
       EXPR_STMT@[180; 181)
         ERROR@[180; 181)
           DOLLAR@[180; 181) "$"
-          err: `expected SEMI`
       EXPR_STMT@[181; 187)
         PATH_EXPR@[181; 187)
           PATH@[181; 187)
             PATH_SEGMENT@[181; 187)
               NAME_REF@[181; 187)
                 IDENT@[181; 187) "output"
-                err: `expected SEMI`
-                err: `expected expression`
       EXPR_STMT@[187; 188)
         ERROR@[187; 188)
           COLON@[187; 188) ":"
-          err: `expected SEMI`
       EXPR_STMT@[188; 192)
         PATH_EXPR@[188; 192)
           PATH@[188; 192)
             PATH_SEGMENT@[188; 192)
               NAME_REF@[188; 192)
                 IDENT@[188; 192) "expr"
-                err: `expected SEMI`
-                err: `expected expression`
       EXPR_STMT@[192; 193)
         ERROR@[192; 193)
           R_PAREN@[192; 193) ")"
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[193; 194)
         ERROR@[193; 194)
           COMMA@[193; 194) ","
-          err: `expected SEMI`
       EXPR_STMT@[194; 197)
         PREFIX_EXPR@[194; 197)
           STAR@[194; 195) "*"
           WHITESPACE@[195; 196) " "
-          err: `expected expression`
           ERROR@[196; 197)
             DOLLAR@[196; 197) "$"
-            err: `expected SEMI`
       EXPR_STMT@[197; 198)
         PAREN_EXPR@[197; 198)
           L_PAREN@[197; 198) "("
-          err: `expected expression`
-          err: `expected R_PAREN`
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[198; 199)
         ERROR@[198; 199)
           COMMA@[198; 199) ","
-          err: `expected SEMI`
-          err: `expected expression`
       EXPR_STMT@[199; 200)
         ERROR@[199; 200)
           R_PAREN@[199; 200) ")"
-          err: `expected SEMI`
       EXPR_STMT@[200; 202)
         PREFIX_EXPR@[200; 202)
           STAR@[200; 201) "*"
-          err: `expected expression`
           ERROR@[201; 202)
             R_BRACK@[201; 202) "]"
-            err: `expected SEMI`
-            err: `expected expression`
       EXPR_STMT@[202; 203)
         ERROR@[202; 203)
           R_PAREN@[202; 203) ")"
-          err: `expected SEMI`
       WHITESPACE@[203; 204) " "
       BLOCK_EXPR@[204; 346)
         BLOCK@[204; 346)
@@ -323,3 +256,70 @@ SOURCE_FILE@[0; 349)
       WHITESPACE@[346; 347) "\n"
       R_CURLY@[347; 348) "}"
   WHITESPACE@[348; 349) "\n"
+err: `expected EXCL`
+err: `expected SEMI`
+err: `expected an item`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected COMMA`
+err: `expected expression`
+err: `expected R_PAREN`
+err: `expected COMMA`
+err: `expected expression`
+err: `expected R_BRACK`
+err: `expected COMMA`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected R_PAREN`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected COMMA`
+err: `expected expression`
+err: `expected R_PAREN`
+err: `expected COMMA`
+err: `expected expression`
+err: `expected R_BRACK`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected R_PAREN`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
+err: `expected expression`
+err: `expected SEMI`
diff --git a/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt b/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt
index 27a0884f9..fa92f0845 100644
--- a/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0029_field_completion.txt
@@ -29,7 +29,7 @@ SOURCE_FILE@[0; 24)
               NAME_REF@[19; 20)
                 IDENT@[19; 20) "a"
         DOT@[20; 21) "."
-        err: `expected field name or number`
       WHITESPACE@[21; 22) "\n"
       R_CURLY@[22; 23) "}"
   WHITESPACE@[23; 24) "\n"
+err: `expected field name or number`
diff --git a/crates/ra_syntax/tests/data/parser/err/0030_string_suffixes.txt b/crates/ra_syntax/tests/data/parser/err/0030_string_suffixes.txt
index e0e38d37d..fb6d3c9c7 100644
--- a/crates/ra_syntax/tests/data/parser/err/0030_string_suffixes.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0030_string_suffixes.txt
@@ -21,7 +21,6 @@ SOURCE_FILE@[0; 112)
         WHITESPACE@[23; 24) " "
         LITERAL@[24; 27)
           CHAR@[24; 27) "\'c\'"
-          err: `expected SEMI`
       EXPR_STMT@[27; 31)
         PATH_EXPR@[27; 30)
           PATH@[27; 30)
@@ -68,3 +67,4 @@ SOURCE_FILE@[0; 112)
       WHITESPACE@[109; 110) "\n"
       R_CURLY@[110; 111) "}"
   WHITESPACE@[111; 112) "\n"
+err: `expected SEMI`
diff --git a/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt b/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt
index 80a973d4d..b4ec999b1 100644
--- a/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0031_block_inner_attrs.txt
@@ -24,7 +24,6 @@ SOURCE_FILE@[0; 350)
           BLOCK@[29; 128)
             L_CURLY@[29; 30) "{"
             WHITESPACE@[30; 39) "\n        "
-            err: `A block in this position cannot accept inner attributes`
             ATTR@[39; 83)
               POUND@[39; 40) "#"
               EXCL@[40; 41) "!"
@@ -53,7 +52,6 @@ SOURCE_FILE@[0; 350)
           BLOCK@[142; 257)
             L_CURLY@[142; 143) "{"
             WHITESPACE@[143; 152) "\n        "
-            err: `A block in this position cannot accept inner attributes`
             ATTR@[152; 171)
               POUND@[152; 153) "#"
               EXCL@[153; 154) "!"
@@ -66,7 +64,6 @@ SOURCE_FILE@[0; 350)
                   R_PAREN@[169; 170) ")"
                 R_BRACK@[170; 171) "]"
             WHITESPACE@[171; 180) "\n        "
-            err: `A block in this position cannot accept inner attributes`
             ATTR@[180; 212)
               POUND@[180; 181) "#"
               EXCL@[181; 182) "!"
@@ -93,7 +90,6 @@ SOURCE_FILE@[0; 350)
         BLOCK@[273; 347)
           L_CURLY@[273; 274) "{"
           WHITESPACE@[274; 283) "\n        "
-          err: `A block in this position cannot accept inner attributes`
           ATTR@[283; 302)
             POUND@[283; 284) "#"
             EXCL@[284; 285) "!"
@@ -112,3 +108,7 @@ SOURCE_FILE@[0; 350)
       WHITESPACE@[347; 348) "\n"
       R_CURLY@[348; 349) "}"
   WHITESPACE@[349; 350) "\n"
+err: `A block in this position cannot accept inner attributes`
+err: `A block in this position cannot accept inner attributes`
+err: `A block in this position cannot accept inner attributes`
+err: `A block in this position cannot accept inner attributes`
diff --git a/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.txt b/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.txt
index 92e3a1ee8..a3c53f353 100644
--- a/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0032_match_arms_inner_attrs.txt
@@ -36,11 +36,8 @@ SOURCE_FILE@[0; 293)
             MATCH_ARM@[51; 78)
               ATTR@[51; 52)
                 POUND@[51; 52) "#"
-                err: `expected `[``
-                err: `expected pattern`
               ERROR@[52; 53)
                 EXCL@[52; 53) "!"
-                err: `expected FAT_ARROW`
               ARRAY_EXPR@[53; 78)
                 L_BRACK@[53; 54) "["
                 CALL_EXPR@[54; 77)
@@ -55,7 +52,6 @@ SOURCE_FILE@[0; 293)
                       STRING@[58; 76) "\"Not allowed here\""
                     R_PAREN@[76; 77) ")"
                 R_BRACK@[77; 78) "]"
-                err: `expected COMMA`
             WHITESPACE@[78; 87) "\n        "
             MATCH_ARM@[87; 94)
               PLACEHOLDER_PAT@[87; 88)
@@ -106,11 +102,8 @@ SOURCE_FILE@[0; 293)
             MATCH_ARM@[160; 179)
               ATTR@[160; 161)
                 POUND@[160; 161) "#"
-                err: `expected `[``
-                err: `expected pattern`
               ERROR@[161; 162)
                 EXCL@[161; 162) "!"
-                err: `expected FAT_ARROW`
               ARRAY_EXPR@[162; 179)
                 L_BRACK@[162; 163) "["
                 CALL_EXPR@[163; 178)
@@ -152,11 +145,8 @@ SOURCE_FILE@[0; 293)
             WHITESPACE@[222; 231) "\n        "
             ATTR@[231; 232)
               POUND@[231; 232) "#"
-              err: `expected `[``
-              err: `expected pattern`
             ERROR@[232; 233)
               EXCL@[232; 233) "!"
-              err: `expected FAT_ARROW`
             ARRAY_EXPR@[233; 250)
               L_BRACK@[233; 234) "["
               CALL_EXPR@[234; 249)
@@ -171,7 +161,6 @@ SOURCE_FILE@[0; 293)
                     STRING@[238; 248) "\"Nor here\""
                   R_PAREN@[248; 249) ")"
               R_BRACK@[249; 250) "]"
-              err: `expected COMMA`
           WHITESPACE@[250; 259) "\n        "
           MATCH_ARM@[259; 266)
             PLACEHOLDER_PAT@[259; 260)
@@ -199,3 +188,14 @@ SOURCE_FILE@[0; 293)
       WHITESPACE@[290; 291) "\n"
       R_CURLY@[291; 292) "}"
   WHITESPACE@[292; 293) "\n"
+err: `expected `[``
+err: `expected pattern`
+err: `expected FAT_ARROW`
+err: `expected COMMA`
+err: `expected `[``
+err: `expected pattern`
+err: `expected FAT_ARROW`
+err: `expected `[``
+err: `expected pattern`
+err: `expected FAT_ARROW`
+err: `expected COMMA`
diff --git a/crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.txt b/crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.txt
index ac9cb63f7..7bcf5ec81 100644
--- a/crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.txt
+++ b/crates/ra_syntax/tests/data/parser/err/0033_match_arms_outer_attrs.txt
@@ -54,11 +54,11 @@ SOURCE_FILE@[0; 89)
                   IDENT@[74; 78) "test"
                   R_PAREN@[78; 79) ")"
                 R_BRACK@[79; 80) "]"
-                err: `expected pattern`
-                err: `expected FAT_ARROW`
-                err: `expected expression`
           WHITESPACE@[80; 85) "\n    "
           R_CURLY@[85; 86) "}"
       WHITESPACE@[86; 87) "\n"
       R_CURLY@[87; 88) "}"
   WHITESPACE@[88; 89) "\n"
+err: `expected pattern`
+err: `expected FAT_ARROW`
+err: `expected expression`
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.txt b/crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.txt
index 3020f9086..eb6d98fcd 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0001_array_type_missing_semi.txt
@@ -12,16 +12,16 @@ SOURCE_FILE@[0; 18)
       TUPLE_TYPE@[10; 12)
         L_PAREN@[10; 11) "("
         R_PAREN@[11; 12) ")"
-        err: `expected `;` or `]``
-        err: `expected SEMI`
   WHITESPACE@[12; 13) " "
-  err: `expected an item`
   ERROR@[13; 15)
     INT_NUMBER@[13; 15) "92"
-    err: `expected an item`
   ERROR@[15; 16)
     R_BRACK@[15; 16) "]"
-    err: `expected an item`
   ERROR@[16; 17)
     SEMI@[16; 17) ";"
   WHITESPACE@[17; 18) "\n"
+err: `expected `;` or `]``
+err: `expected SEMI`
+err: `expected an item`
+err: `expected an item`
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0002_misplaced_label_err.txt b/crates/ra_syntax/tests/data/parser/inline/err/0002_misplaced_label_err.txt
index d61d8e73e..b1d104bd4 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0002_misplaced_label_err.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0002_misplaced_label_err.txt
@@ -16,13 +16,13 @@ SOURCE_FILE@[0; 30)
           LABEL@[16; 22)
             LIFETIME@[16; 21) "\'loop"
             COLON@[21; 22) ":"
-            err: `expected a loop`
-            err: `expected SEMI`
       WHITESPACE@[22; 23) " "
       IMPL_BLOCK@[23; 27)
         IMPL_KW@[23; 27) "impl"
-        err: `expected type`
-        err: `expected `{``
       WHITESPACE@[27; 28) "\n"
       R_CURLY@[28; 29) "}"
   WHITESPACE@[29; 30) "\n"
+err: `expected a loop`
+err: `expected SEMI`
+err: `expected type`
+err: `expected `{``
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.txt b/crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.txt
index 3d7a6a745..b470d9ad1 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0003_pointer_type_no_mutability.txt
@@ -9,9 +9,9 @@ SOURCE_FILE@[0; 14)
     WHITESPACE@[8; 9) " "
     POINTER_TYPE@[9; 12)
       STAR@[9; 10) "*"
-      err: `expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)`
       TUPLE_TYPE@[10; 12)
         L_PAREN@[10; 11) "("
         R_PAREN@[11; 12) ")"
     SEMI@[12; 13) ";"
   WHITESPACE@[13; 14) "\n"
+err: `expected mut or const in raw pointer type (use `*mut T` or `*const T` as appropriate)`
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0004_impl_type.txt b/crates/ra_syntax/tests/data/parser/inline/err/0004_impl_type.txt
index 86f84459a..ef4e0d5dd 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0004_impl_type.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0004_impl_type.txt
@@ -35,8 +35,6 @@ SOURCE_FILE@[0; 87)
   WHITESPACE@[33; 34) "\n"
   IMPL_BLOCK@[34; 38)
     IMPL_KW@[34; 38) "impl"
-    err: `expected trait or type`
-    err: `expected `{``
   WHITESPACE@[38; 39) " "
   IMPL_BLOCK@[39; 54)
     IMPL_KW@[39; 43) "impl"
@@ -61,8 +59,6 @@ SOURCE_FILE@[0; 87)
             IDENT@[60; 66) "Trait2"
     WHITESPACE@[66; 67) " "
     FOR_KW@[67; 70) "for"
-    err: `expected trait or type`
-    err: `expected `{``
   WHITESPACE@[70; 71) " "
   IMPL_BLOCK@[71; 86)
     IMPL_KW@[71; 75) "impl"
@@ -77,3 +73,7 @@ SOURCE_FILE@[0; 87)
       L_CURLY@[84; 85) "{"
       R_CURLY@[85; 86) "}"
   WHITESPACE@[86; 87) "\n"
+err: `expected trait or type`
+err: `expected `{``
+err: `expected trait or type`
+err: `expected `{``
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt b/crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt
index 4587525aa..41e623b41 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0005_fn_pointer_type_missing_fn.txt
@@ -8,16 +8,16 @@ SOURCE_FILE@[0; 20)
     EQ@[7; 8) "="
     WHITESPACE@[8; 9) " "
     UNSAFE_KW@[9; 15) "unsafe"
-    err: `expected `fn``
-    err: `expected SEMI`
   WHITESPACE@[15; 16) " "
-  err: `expected an item`
   ERROR@[16; 17)
     L_PAREN@[16; 17) "("
-    err: `expected an item`
   ERROR@[17; 18)
     R_PAREN@[17; 18) ")"
-    err: `expected an item`
   ERROR@[18; 19)
     SEMI@[18; 19) ";"
   WHITESPACE@[19; 20) "\n"
+err: `expected `fn``
+err: `expected SEMI`
+err: `expected an item`
+err: `expected an item`
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0006_unsafe_block_in_mod.txt b/crates/ra_syntax/tests/data/parser/inline/err/0006_unsafe_block_in_mod.txt
index fefa35c20..f1d0dd5c6 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0006_unsafe_block_in_mod.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0006_unsafe_block_in_mod.txt
@@ -11,11 +11,9 @@ SOURCE_FILE@[0; 33)
       L_CURLY@[8; 9) "{"
       R_CURLY@[9; 10) "}"
   WHITESPACE@[10; 11) " "
-  err: `expected an item`
   ERROR@[11; 17)
     UNSAFE_KW@[11; 17) "unsafe"
   WHITESPACE@[17; 18) " "
-  err: `expected an item`
   ERROR@[18; 21)
     L_CURLY@[18; 19) "{"
     WHITESPACE@[19; 20) " "
@@ -33,3 +31,5 @@ SOURCE_FILE@[0; 33)
       L_CURLY@[30; 31) "{"
       R_CURLY@[31; 32) "}"
   WHITESPACE@[32; 33) "\n"
+err: `expected an item`
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0007_async_without_semicolon.txt b/crates/ra_syntax/tests/data/parser/inline/err/0007_async_without_semicolon.txt
index 8afcd5429..1a8fa029c 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0007_async_without_semicolon.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0007_async_without_semicolon.txt
@@ -25,7 +25,7 @@ SOURCE_FILE@[0; 30)
           BLOCK@[25; 27)
             L_CURLY@[25; 26) "{"
             R_CURLY@[26; 27) "}"
-            err: `expected SEMI`
       WHITESPACE@[27; 28) " "
       R_CURLY@[28; 29) "}"
   WHITESPACE@[29; 30) "\n"
+err: `expected SEMI`
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0008_pub_expr.txt b/crates/ra_syntax/tests/data/parser/inline/err/0008_pub_expr.txt
index 1af31c48b..cadbbc078 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0008_pub_expr.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0008_pub_expr.txt
@@ -14,7 +14,6 @@ SOURCE_FILE@[0; 21)
       ERROR@[11; 14)
         VISIBILITY@[11; 14)
           PUB_KW@[11; 14) "pub"
-          err: `expected an item`
       WHITESPACE@[14; 15) " "
       EXPR_STMT@[15; 18)
         LITERAL@[15; 17)
@@ -23,3 +22,4 @@ SOURCE_FILE@[0; 21)
       WHITESPACE@[18; 19) " "
       R_CURLY@[19; 20) "}"
   WHITESPACE@[20; 21) "\n"
+err: `expected an item`
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0009_attr_on_expr_not_allowed.txt b/crates/ra_syntax/tests/data/parser/inline/err/0009_attr_on_expr_not_allowed.txt
index 9d50a520f..8e7d7d241 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0009_attr_on_expr_not_allowed.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0009_attr_on_expr_not_allowed.txt
@@ -27,7 +27,6 @@ SOURCE_FILE@[0; 48)
           WHITESPACE@[22; 23) " "
           LITERAL@[23; 24)
             INT_NUMBER@[23; 24) "2"
-            err: `attributes are not allowed on BIN_EXPR`
         SEMI@[24; 25) ";"
       WHITESPACE@[25; 29) "\n   "
       EXPR_STMT@[29; 45)
@@ -48,8 +47,9 @@ SOURCE_FILE@[0; 48)
           BLOCK@[42; 44)
             L_CURLY@[42; 43) "{"
             R_CURLY@[43; 44) "}"
-            err: `attributes are not allowed on IF_EXPR`
         SEMI@[44; 45) ";"
       WHITESPACE@[45; 46) "\n"
       R_CURLY@[46; 47) "}"
   WHITESPACE@[47; 48) "\n"
+err: `attributes are not allowed on BIN_EXPR`
+err: `attributes are not allowed on IF_EXPR`
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0010_bad_tuple_index_expr.txt b/crates/ra_syntax/tests/data/parser/inline/err/0010_bad_tuple_index_expr.txt
index c111f60ea..36717439e 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0010_bad_tuple_index_expr.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0010_bad_tuple_index_expr.txt
@@ -19,7 +19,6 @@ SOURCE_FILE@[0; 47)
                 NAME_REF@[15; 16)
                   IDENT@[15; 16) "x"
           DOT@[16; 17) "."
-          err: `Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix`
           FLOAT_NUMBER@[17; 19) "0."
         SEMI@[19; 20) ";"
       WHITESPACE@[20; 25) "\n    "
@@ -31,7 +30,6 @@ SOURCE_FILE@[0; 47)
                 NAME_REF@[25; 26)
                   IDENT@[25; 26) "x"
           DOT@[26; 27) "."
-          err: `Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix`
           INT_NUMBER@[27; 31) "1i32"
         SEMI@[31; 32) ";"
       WHITESPACE@[32; 37) "\n    "
@@ -43,9 +41,11 @@ SOURCE_FILE@[0; 47)
                 NAME_REF@[37; 38)
                   IDENT@[37; 38) "x"
           DOT@[38; 39) "."
-          err: `Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix`
           INT_NUMBER@[39; 43) "0x01"
         SEMI@[43; 44) ";"
       WHITESPACE@[44; 45) "\n"
       R_CURLY@[45; 46) "}"
   WHITESPACE@[46; 47) "\n"
+err: `Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix`
+err: `Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix`
+err: `Tuple (struct) field access is only allowed through decimal integers with no underscores or suffix`
diff --git a/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt b/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt
index 220191ffa..5f39e7238 100644
--- a/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt
+++ b/crates/ra_syntax/tests/data/parser/inline/err/0010_wrong_order_fns.txt
@@ -1,7 +1,6 @@
 SOURCE_FILE@[0; 50)
   ERROR@[0; 5)
     ASYNC_KW@[0; 5) "async"
-    err: `expected fn, trait or impl`
   WHITESPACE@[5; 6) " "
   FN_DEF@[6; 24)
     UNSAFE_KW@[6; 12) "unsafe"
@@ -20,7 +19,6 @@ SOURCE_FILE@[0; 50)
   WHITESPACE@[24; 25) "\n"
   ERROR@[25; 31)
     UNSAFE_KW@[25; 31) "unsafe"
-    err: `expected fn, trait or impl`
   WHITESPACE@[31; 32) " "
   FN_DEF@[32; 49)
     CONST_KW@[32; 37) "const"
@@ -37,3 +35,5 @@ SOURCE_FILE@[0; 50)
       L_CURLY@[47; 48) "{"
       R_CURLY@[48; 49) "}"
   WHITESPACE@[49; 50) "\n"
+err: `expected fn, trait or impl`
+err: `expected fn, trait or impl`
-- 
cgit v1.2.3


From 0efbcdf43544af471a935c790ae99e2a9b5516c3 Mon Sep 17 00:00:00 2001
From: Aleksey Kladov <aleksey.kladov@gmail.com>
Date: Tue, 28 May 2019 17:34:28 +0300
Subject: remove old parsing methods

---
 crates/ra_syntax/tests/test.rs | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'crates/ra_syntax/tests')

diff --git a/crates/ra_syntax/tests/test.rs b/crates/ra_syntax/tests/test.rs
index 4b711f271..f31e12588 100644
--- a/crates/ra_syntax/tests/test.rs
+++ b/crates/ra_syntax/tests/test.rs
@@ -21,7 +21,7 @@ fn lexer_tests() {
 #[test]
 fn parser_tests() {
     dir_tests(&test_data_dir(), &["parser/inline/ok", "parser/ok"], |text, path| {
-        let parse = SourceFile::parse2(text);
+        let parse = SourceFile::parse(text);
         let errors = parse.errors.as_slice();
         assert_eq!(
             errors,
@@ -32,7 +32,7 @@ fn parser_tests() {
         parse.debug_dump()
     });
     dir_tests(&test_data_dir(), &["parser/err", "parser/inline/err"], |text, path| {
-        let parse = SourceFile::parse2(text);
+        let parse = SourceFile::parse(text);
         let errors = parse.errors.as_slice();
         assert!(!errors.is_empty(), "There should be errors in the file {:?}", path.display());
         parse.debug_dump()
@@ -78,9 +78,7 @@ fn self_hosting_parsing() {
     {
         count += 1;
         let text = read_text(entry.path());
-        let node = SourceFile::parse(&text);
-        let errors = node.errors();
-        assert_eq!(&*errors, &[], "There should be no errors in the file {:?}", entry);
+        SourceFile::parse(&text).ok().expect("There should be no errors in the file");
     }
     assert!(
         count > 30,
-- 
cgit v1.2.3