From c4fd46398132a409d7947141094d7301c0f0af73 Mon Sep 17 00:00:00 2001 From: Avi Dessauer Date: Thu, 4 Jun 2020 13:06:26 -0400 Subject: Move default const test out of line --- .../test_data/parser/err/0043_default_const.rast | 40 ++++++++++++++++++++++ .../test_data/parser/err/0043_default_const.rs | 3 ++ 2 files changed, 43 insertions(+) create mode 100644 crates/ra_syntax/test_data/parser/err/0043_default_const.rast create mode 100644 crates/ra_syntax/test_data/parser/err/0043_default_const.rs (limited to 'crates/ra_syntax/test_data/parser/err') diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rast b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast new file mode 100644 index 000000000..8eb583ef8 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0043_default_const.rast @@ -0,0 +1,40 @@ +SOURCE_FILE@0..39 + TRAIT_DEF@0..38 + TRAIT_KW@0..5 "trait" + WHITESPACE@5..6 " " + NAME@6..7 + IDENT@6..7 "T" + WHITESPACE@7..8 " " + ITEM_LIST@8..38 + L_CURLY@8..9 "{" + WHITESPACE@9..12 "\n " + MACRO_CALL@12..19 + PATH@12..19 + PATH_SEGMENT@12..19 + NAME_REF@12..19 + IDENT@12..19 "default" + WHITESPACE@19..20 " " + CONST_DEF@20..36 + CONST_KW@20..25 "const" + WHITESPACE@25..26 " " + NAME@26..27 + IDENT@26..27 "f" + COLON@27..28 ":" + WHITESPACE@28..29 " " + PATH_TYPE@29..31 + PATH@29..31 + PATH_SEGMENT@29..31 + NAME_REF@29..31 + IDENT@29..31 "u8" + WHITESPACE@31..32 " " + EQ@32..33 "=" + WHITESPACE@33..34 " " + LITERAL@34..35 + INT_NUMBER@34..35 "0" + SEMICOLON@35..36 ";" + WHITESPACE@36..37 "\n" + R_CURLY@37..38 "}" + WHITESPACE@38..39 "\n" +error 19..19: expected BANG +error 19..19: expected `{`, `[`, `(` +error 19..19: expected SEMICOLON diff --git a/crates/ra_syntax/test_data/parser/err/0043_default_const.rs b/crates/ra_syntax/test_data/parser/err/0043_default_const.rs new file mode 100644 index 000000000..80f15474a --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0043_default_const.rs @@ -0,0 +1,3 @@ +trait T { + default const f: u8 = 0; +} -- cgit v1.2.3 From e8d50578ab2702ff5f0955285c979c6923f14f80 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 9 Jun 2020 13:45:18 +0200 Subject: Correctly parse <_> paths in patterns closes #3659 --- .../parser/err/0024_many_type_parens.rast | 74 +++++++++++----------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'crates/ra_syntax/test_data/parser/err') diff --git a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast index 7c957fdde..48610a5eb 100644 --- a/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast +++ b/crates/ra_syntax/test_data/parser/err/0024_many_type_parens.rast @@ -180,44 +180,45 @@ SOURCE_FILE@0..240 EXPR_STMT@150..180 TUPLE_EXPR@150..180 L_PAREN@150..151 "(" - BIN_EXPR@151..180 - BIN_EXPR@151..178 - BIN_EXPR@151..169 - BIN_EXPR@151..167 - BIN_EXPR@151..164 - FOR_EXPR@151..157 - FOR_KW@151..154 "for" - ERROR@154..155 - L_ANGLE@154..155 "<" - ERROR@155..157 - LIFETIME@155..157 "\'a" - R_ANGLE@157..158 ">" - WHITESPACE@158..159 " " + FOR_EXPR@151..180 + FOR_KW@151..154 "for" + PATH_PAT@154..158 + PATH@154..158 + PATH_SEGMENT@154..158 + L_ANGLE@154..155 "<" + ERROR@155..157 + LIFETIME@155..157 "\'a" + R_ANGLE@157..158 ">" + WHITESPACE@158..159 " " + BIN_EXPR@159..180 + BIN_EXPR@159..178 + BIN_EXPR@159..169 + BIN_EXPR@159..167 PATH_EXPR@159..164 PATH@159..164 PATH_SEGMENT@159..164 NAME_REF@159..164 IDENT@159..164 "Trait" - L_ANGLE@164..165 "<" - ERROR@165..167 - LIFETIME@165..167 "\'a" - R_ANGLE@167..168 ">" - ERROR@168..169 - R_PAREN@168..169 ")" - WHITESPACE@169..170 " " - PLUS@170..171 "+" - WHITESPACE@171..172 " " - PAREN_EXPR@172..178 - L_PAREN@172..173 "(" - PATH_EXPR@173..177 - PATH@173..177 - PATH_SEGMENT@173..177 - NAME_REF@173..177 - IDENT@173..177 "Copy" - R_PAREN@177..178 ")" - R_ANGLE@178..179 ">" - ERROR@179..180 - SEMICOLON@179..180 ";" + L_ANGLE@164..165 "<" + ERROR@165..167 + LIFETIME@165..167 "\'a" + R_ANGLE@167..168 ">" + ERROR@168..169 + R_PAREN@168..169 ")" + WHITESPACE@169..170 " " + PLUS@170..171 "+" + WHITESPACE@171..172 " " + PAREN_EXPR@172..178 + L_PAREN@172..173 "(" + PATH_EXPR@173..177 + PATH@173..177 + PATH_SEGMENT@173..177 + NAME_REF@173..177 + IDENT@173..177 "Copy" + R_PAREN@177..178 ")" + R_ANGLE@178..179 ">" + ERROR@179..180 + SEMICOLON@179..180 ";" WHITESPACE@180..185 "\n " LET_STMT@185..235 LET_KW@185..188 "let" @@ -302,13 +303,12 @@ error 146..146: expected expression error 147..147: expected SEMICOLON error 148..148: expected expression error 149..149: expected SEMICOLON -error 154..154: expected pattern -error 155..155: expected IN_KW -error 155..155: expected expression -error 157..157: expected a block +error 155..155: expected type +error 158..158: expected IN_KW error 165..165: expected expression error 168..168: expected expression error 179..179: expected expression +error 180..180: expected a block error 180..180: expected COMMA error 180..180: expected expression error 180..180: expected R_PAREN -- cgit v1.2.3 From 506e1ddbfa5213f254923da9bbf0efddc6f1fc34 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Wed, 10 Jun 2020 11:30:48 +0100 Subject: Separating parsing of `for` in predicates and types --- .../parser/err/0027_incomplere_where_for.rast | 15 ++-- .../parser/err/0044_unexpected_for_type.rast | 88 ++++++++++++++++++++++ .../parser/err/0044_unexpected_for_type.rs | 3 + 3 files changed, 98 insertions(+), 8 deletions(-) create mode 100644 crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast create mode 100644 crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rs (limited to 'crates/ra_syntax/test_data/parser/err') diff --git a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast index 568a4cc02..4d6461d1e 100644 --- a/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast +++ b/crates/ra_syntax/test_data/parser/err/0027_incomplere_where_for.rast @@ -12,17 +12,16 @@ SOURCE_FILE@0..30 WHERE_KW@13..18 "where" WHITESPACE@18..19 " " WHERE_PRED@19..26 - FOR_TYPE@19..26 - FOR_KW@19..22 "for" - TYPE_PARAM_LIST@22..26 - L_ANGLE@22..23 "<" - LIFETIME_PARAM@23..25 - LIFETIME@23..25 "\'a" - R_ANGLE@25..26 ">" + FOR_KW@19..22 "for" + TYPE_PARAM_LIST@22..26 + L_ANGLE@22..23 "<" + LIFETIME_PARAM@23..25 + LIFETIME@23..25 "\'a" + R_ANGLE@25..26 ">" WHITESPACE@26..27 "\n" BLOCK_EXPR@27..29 L_CURLY@27..28 "{" R_CURLY@28..29 "}" WHITESPACE@29..30 "\n" -error 26..26: expected a path +error 26..26: expected type error 26..26: expected colon diff --git a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast new file mode 100644 index 000000000..3400beff0 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast @@ -0,0 +1,88 @@ +SOURCE_FILE@0..79 + TYPE_ALIAS_DEF@0..25 + TYPE_KW@0..4 "type" + WHITESPACE@4..5 " " + NAME@5..6 + IDENT@5..6 "A" + WHITESPACE@6..7 " " + EQ@7..8 "=" + WHITESPACE@8..9 " " + FOR_TYPE@9..24 + FOR_KW@9..12 "for" + TYPE_PARAM_LIST@12..16 + L_ANGLE@12..13 "<" + LIFETIME_PARAM@13..15 + LIFETIME@13..15 "\'a" + R_ANGLE@15..16 ">" + WHITESPACE@16..17 " " + REFERENCE_TYPE@17..24 + AMP@17..18 "&" + LIFETIME@18..20 "\'a" + WHITESPACE@20..21 " " + PATH_TYPE@21..24 + PATH@21..24 + PATH_SEGMENT@21..24 + NAME_REF@21..24 + IDENT@21..24 "u32" + SEMICOLON@24..25 ";" + WHITESPACE@25..26 "\n" + TYPE_ALIAS_DEF@26..54 + TYPE_KW@26..30 "type" + WHITESPACE@30..31 " " + NAME@31..32 + IDENT@31..32 "B" + WHITESPACE@32..33 " " + EQ@33..34 "=" + WHITESPACE@34..35 " " + FOR_TYPE@35..53 + FOR_KW@35..38 "for" + TYPE_PARAM_LIST@38..42 + L_ANGLE@38..39 "<" + LIFETIME_PARAM@39..41 + LIFETIME@39..41 "\'a" + R_ANGLE@41..42 ">" + WHITESPACE@42..43 " " + TUPLE_TYPE@43..53 + L_PAREN@43..44 "(" + REFERENCE_TYPE@44..51 + AMP@44..45 "&" + LIFETIME@45..47 "\'a" + WHITESPACE@47..48 " " + PATH_TYPE@48..51 + PATH@48..51 + PATH_SEGMENT@48..51 + NAME_REF@48..51 + IDENT@48..51 "u32" + COMMA@51..52 "," + R_PAREN@52..53 ")" + SEMICOLON@53..54 ";" + WHITESPACE@54..55 "\n" + TYPE_ALIAS_DEF@55..78 + TYPE_KW@55..59 "type" + WHITESPACE@59..60 " " + NAME@60..61 + IDENT@60..61 "B" + WHITESPACE@61..62 " " + EQ@62..63 "=" + WHITESPACE@63..64 " " + FOR_TYPE@64..77 + FOR_KW@64..67 "for" + TYPE_PARAM_LIST@67..71 + L_ANGLE@67..68 "<" + LIFETIME_PARAM@68..70 + LIFETIME@68..70 "\'a" + R_ANGLE@70..71 ">" + WHITESPACE@71..72 " " + SLICE_TYPE@72..77 + L_BRACK@72..73 "[" + PATH_TYPE@73..76 + PATH@73..76 + PATH_SEGMENT@73..76 + NAME_REF@73..76 + IDENT@73..76 "u32" + R_BRACK@76..77 "]" + SEMICOLON@77..78 ";" + WHITESPACE@78..79 "\n" +error 16..16: expected a function pointer or path +error 42..42: expected a function pointer or path +error 71..71: expected a function pointer or path diff --git a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rs b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rs new file mode 100644 index 000000000..f34ac7fc5 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rs @@ -0,0 +1,3 @@ +type A = for<'a> &'a u32; +type B = for<'a> (&'a u32,); +type B = for<'a> [u32]; -- cgit v1.2.3 From 879693e63c19b474153473e11f96ab9c321739db Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Thu, 11 Jun 2020 18:14:57 +0100 Subject: Move complex inline test to own file --- .../parser/err/0044_unexpected_for_type.rast | 324 +++++++++++++++------ .../parser/err/0044_unexpected_for_type.rs | 12 +- 2 files changed, 247 insertions(+), 89 deletions(-) (limited to 'crates/ra_syntax/test_data/parser/err') diff --git a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast index 3400beff0..cb90f28bc 100644 --- a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast +++ b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rast @@ -1,88 +1,240 @@ -SOURCE_FILE@0..79 - TYPE_ALIAS_DEF@0..25 +SOURCE_FILE@0..239 + TYPE_ALIAS_DEF@0..30 TYPE_KW@0..4 "type" WHITESPACE@4..5 " " - NAME@5..6 - IDENT@5..6 "A" - WHITESPACE@6..7 " " - EQ@7..8 "=" - WHITESPACE@8..9 " " - FOR_TYPE@9..24 - FOR_KW@9..12 "for" - TYPE_PARAM_LIST@12..16 - L_ANGLE@12..13 "<" - LIFETIME_PARAM@13..15 - LIFETIME@13..15 "\'a" - R_ANGLE@15..16 ">" - WHITESPACE@16..17 " " - REFERENCE_TYPE@17..24 - AMP@17..18 "&" - LIFETIME@18..20 "\'a" - WHITESPACE@20..21 " " - PATH_TYPE@21..24 - PATH@21..24 - PATH_SEGMENT@21..24 - NAME_REF@21..24 - IDENT@21..24 "u32" - SEMICOLON@24..25 ";" - WHITESPACE@25..26 "\n" - TYPE_ALIAS_DEF@26..54 - TYPE_KW@26..30 "type" - WHITESPACE@30..31 " " - NAME@31..32 - IDENT@31..32 "B" - WHITESPACE@32..33 " " - EQ@33..34 "=" - WHITESPACE@34..35 " " - FOR_TYPE@35..53 - FOR_KW@35..38 "for" - TYPE_PARAM_LIST@38..42 - L_ANGLE@38..39 "<" - LIFETIME_PARAM@39..41 - LIFETIME@39..41 "\'a" - R_ANGLE@41..42 ">" - WHITESPACE@42..43 " " - TUPLE_TYPE@43..53 - L_PAREN@43..44 "(" - REFERENCE_TYPE@44..51 - AMP@44..45 "&" - LIFETIME@45..47 "\'a" - WHITESPACE@47..48 " " - PATH_TYPE@48..51 - PATH@48..51 - PATH_SEGMENT@48..51 - NAME_REF@48..51 - IDENT@48..51 "u32" - COMMA@51..52 "," - R_PAREN@52..53 ")" - SEMICOLON@53..54 ";" - WHITESPACE@54..55 "\n" - TYPE_ALIAS_DEF@55..78 - TYPE_KW@55..59 "type" - WHITESPACE@59..60 " " - NAME@60..61 - IDENT@60..61 "B" - WHITESPACE@61..62 " " - EQ@62..63 "=" - WHITESPACE@63..64 " " - FOR_TYPE@64..77 - FOR_KW@64..67 "for" - TYPE_PARAM_LIST@67..71 - L_ANGLE@67..68 "<" - LIFETIME_PARAM@68..70 - LIFETIME@68..70 "\'a" - R_ANGLE@70..71 ">" - WHITESPACE@71..72 " " - SLICE_TYPE@72..77 - L_BRACK@72..73 "[" - PATH_TYPE@73..76 - PATH@73..76 - PATH_SEGMENT@73..76 - NAME_REF@73..76 - IDENT@73..76 "u32" - R_BRACK@76..77 "]" - SEMICOLON@77..78 ";" - WHITESPACE@78..79 "\n" -error 16..16: expected a function pointer or path -error 42..42: expected a function pointer or path -error 71..71: expected a function pointer or path + NAME@5..11 + IDENT@5..11 "ForRef" + WHITESPACE@11..12 " " + EQ@12..13 "=" + WHITESPACE@13..14 " " + FOR_TYPE@14..29 + FOR_KW@14..17 "for" + TYPE_PARAM_LIST@17..21 + L_ANGLE@17..18 "<" + LIFETIME_PARAM@18..20 + LIFETIME@18..20 "\'a" + R_ANGLE@20..21 ">" + WHITESPACE@21..22 " " + REFERENCE_TYPE@22..29 + AMP@22..23 "&" + LIFETIME@23..25 "\'a" + WHITESPACE@25..26 " " + PATH_TYPE@26..29 + PATH@26..29 + PATH_SEGMENT@26..29 + NAME_REF@26..29 + IDENT@26..29 "u32" + SEMICOLON@29..30 ";" + WHITESPACE@30..31 "\n" + TYPE_ALIAS_DEF@31..64 + TYPE_KW@31..35 "type" + WHITESPACE@35..36 " " + NAME@36..42 + IDENT@36..42 "ForTup" + WHITESPACE@42..43 " " + EQ@43..44 "=" + WHITESPACE@44..45 " " + FOR_TYPE@45..63 + FOR_KW@45..48 "for" + TYPE_PARAM_LIST@48..52 + L_ANGLE@48..49 "<" + LIFETIME_PARAM@49..51 + LIFETIME@49..51 "\'a" + R_ANGLE@51..52 ">" + WHITESPACE@52..53 " " + TUPLE_TYPE@53..63 + L_PAREN@53..54 "(" + REFERENCE_TYPE@54..61 + AMP@54..55 "&" + LIFETIME@55..57 "\'a" + WHITESPACE@57..58 " " + PATH_TYPE@58..61 + PATH@58..61 + PATH_SEGMENT@58..61 + NAME_REF@58..61 + IDENT@58..61 "u32" + COMMA@61..62 "," + R_PAREN@62..63 ")" + SEMICOLON@63..64 ";" + WHITESPACE@64..65 "\n" + TYPE_ALIAS_DEF@65..95 + TYPE_KW@65..69 "type" + WHITESPACE@69..70 " " + NAME@70..78 + IDENT@70..78 "ForSlice" + WHITESPACE@78..79 " " + EQ@79..80 "=" + WHITESPACE@80..81 " " + FOR_TYPE@81..94 + FOR_KW@81..84 "for" + TYPE_PARAM_LIST@84..88 + L_ANGLE@84..85 "<" + LIFETIME_PARAM@85..87 + LIFETIME@85..87 "\'a" + R_ANGLE@87..88 ">" + WHITESPACE@88..89 " " + SLICE_TYPE@89..94 + L_BRACK@89..90 "[" + PATH_TYPE@90..93 + PATH@90..93 + PATH_SEGMENT@90..93 + NAME_REF@90..93 + IDENT@90..93 "u32" + R_BRACK@93..94 "]" + SEMICOLON@94..95 ";" + WHITESPACE@95..96 "\n" + TYPE_ALIAS_DEF@96..149 + TYPE_KW@96..100 "type" + WHITESPACE@100..101 " " + NAME@101..109 + IDENT@101..109 "ForForFn" + WHITESPACE@109..110 " " + EQ@110..111 "=" + WHITESPACE@111..112 " " + FOR_TYPE@112..148 + FOR_KW@112..115 "for" + TYPE_PARAM_LIST@115..119 + L_ANGLE@115..116 "<" + LIFETIME_PARAM@116..118 + LIFETIME@116..118 "\'a" + R_ANGLE@118..119 ">" + WHITESPACE@119..120 " " + FOR_TYPE@120..148 + FOR_KW@120..123 "for" + TYPE_PARAM_LIST@123..127 + L_ANGLE@123..124 "<" + LIFETIME_PARAM@124..126 + LIFETIME@124..126 "\'b" + R_ANGLE@126..127 ">" + WHITESPACE@127..128 " " + FN_POINTER_TYPE@128..148 + FN_KW@128..130 "fn" + PARAM_LIST@130..148 + L_PAREN@130..131 "(" + PARAM@131..138 + REFERENCE_TYPE@131..138 + AMP@131..132 "&" + LIFETIME@132..134 "\'a" + WHITESPACE@134..135 " " + PATH_TYPE@135..138 + PATH@135..138 + PATH_SEGMENT@135..138 + NAME_REF@135..138 + IDENT@135..138 "i32" + COMMA@138..139 "," + WHITESPACE@139..140 " " + PARAM@140..147 + REFERENCE_TYPE@140..147 + AMP@140..141 "&" + LIFETIME@141..143 "\'b" + WHITESPACE@143..144 " " + PATH_TYPE@144..147 + PATH@144..147 + PATH_SEGMENT@144..147 + NAME_REF@144..147 + IDENT@144..147 "i32" + R_PAREN@147..148 ")" + SEMICOLON@148..149 ";" + WHITESPACE@149..150 "\n" + FN_DEF@150..238 + FN_KW@150..152 "fn" + WHITESPACE@152..153 " " + NAME@153..164 + IDENT@153..164 "for_for_for" + TYPE_PARAM_LIST@164..167 + L_ANGLE@164..165 "<" + TYPE_PARAM@165..166 + NAME@165..166 + IDENT@165..166 "T" + R_ANGLE@166..167 ">" + PARAM_LIST@167..169 + L_PAREN@167..168 "(" + R_PAREN@168..169 ")" + WHITESPACE@169..170 "\n" + WHERE_CLAUSE@170..234 + WHERE_KW@170..175 "where" + WHITESPACE@175..180 "\n " + WHERE_PRED@180..233 + FOR_KW@180..183 "for" + TYPE_PARAM_LIST@183..187 + L_ANGLE@183..184 "<" + LIFETIME_PARAM@184..186 + LIFETIME@184..186 "\'a" + R_ANGLE@186..187 ">" + WHITESPACE@187..188 " " + FOR_TYPE@188..227 + FOR_KW@188..191 "for" + TYPE_PARAM_LIST@191..195 + L_ANGLE@191..192 "<" + LIFETIME_PARAM@192..194 + LIFETIME@192..194 "\'b" + R_ANGLE@194..195 ">" + WHITESPACE@195..196 " " + FOR_TYPE@196..227 + FOR_KW@196..199 "for" + TYPE_PARAM_LIST@199..203 + L_ANGLE@199..200 "<" + LIFETIME_PARAM@200..202 + LIFETIME@200..202 "\'c" + R_ANGLE@202..203 ">" + WHITESPACE@203..204 " " + FN_POINTER_TYPE@204..227 + FN_KW@204..206 "fn" + PARAM_LIST@206..227 + L_PAREN@206..207 "(" + PARAM@207..212 + REFERENCE_TYPE@207..212 + AMP@207..208 "&" + LIFETIME@208..210 "\'a" + WHITESPACE@210..211 " " + PATH_TYPE@211..212 + PATH@211..212 + PATH_SEGMENT@211..212 + NAME_REF@211..212 + IDENT@211..212 "T" + COMMA@212..213 "," + WHITESPACE@213..214 " " + PARAM@214..219 + REFERENCE_TYPE@214..219 + AMP@214..215 "&" + LIFETIME@215..217 "\'b" + WHITESPACE@217..218 " " + PATH_TYPE@218..219 + PATH@218..219 + PATH_SEGMENT@218..219 + NAME_REF@218..219 + IDENT@218..219 "T" + COMMA@219..220 "," + WHITESPACE@220..221 " " + PARAM@221..226 + REFERENCE_TYPE@221..226 + AMP@221..222 "&" + LIFETIME@222..224 "\'c" + WHITESPACE@224..225 " " + PATH_TYPE@225..226 + PATH@225..226 + PATH_SEGMENT@225..226 + NAME_REF@225..226 + IDENT@225..226 "T" + R_PAREN@226..227 ")" + COLON@227..228 ":" + WHITESPACE@228..229 " " + TYPE_BOUND_LIST@229..233 + TYPE_BOUND@229..233 + PATH_TYPE@229..233 + PATH@229..233 + PATH_SEGMENT@229..233 + NAME_REF@229..233 + IDENT@229..233 "Copy" + COMMA@233..234 "," + WHITESPACE@234..235 "\n" + BLOCK_EXPR@235..238 + L_CURLY@235..236 "{" + WHITESPACE@236..237 "\n" + R_CURLY@237..238 "}" + WHITESPACE@238..239 "\n" +error 21..21: expected a function pointer or path +error 52..52: expected a function pointer or path +error 88..88: expected a function pointer or path +error 119..119: expected a function pointer or path +error 195..195: expected a function pointer or path diff --git a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rs b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rs index f34ac7fc5..0e9f8ccb4 100644 --- a/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rs +++ b/crates/ra_syntax/test_data/parser/err/0044_unexpected_for_type.rs @@ -1,3 +1,9 @@ -type A = for<'a> &'a u32; -type B = for<'a> (&'a u32,); -type B = for<'a> [u32]; +type ForRef = for<'a> &'a u32; +type ForTup = for<'a> (&'a u32,); +type ForSlice = for<'a> [u32]; +type ForForFn = for<'a> for<'b> fn(&'a i32, &'b i32); +fn for_for_for() +where + for<'a> for<'b> for<'c> fn(&'a T, &'b T, &'c T): Copy, +{ +} -- cgit v1.2.3