mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 21:13:37 +00:00
Test for error recovery for broken parameters
This commit is contained in:
parent
8ca02acb5a
commit
b9cbbfa405
2 changed files with 47 additions and 0 deletions
|
@ -0,0 +1,5 @@
|
||||||
|
struct S<90 + 2> {
|
||||||
|
f: u32
|
||||||
|
}
|
||||||
|
|
||||||
|
struct T;
|
42
tests/data/parser/err/0009_broken_struct_type_parameter.txt
Normal file
42
tests/data/parser/err/0009_broken_struct_type_parameter.txt
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
FILE@[0; 43)
|
||||||
|
STRUCT_ITEM@[0; 12)
|
||||||
|
STRUCT_KW@[0; 6)
|
||||||
|
WHITESPACE@[6; 7)
|
||||||
|
IDENT@[7; 8)
|
||||||
|
TYPE_PARAM_LIST@[8; 12)
|
||||||
|
L_ANGLE@[8; 9)
|
||||||
|
ERROR@[9; 12)
|
||||||
|
err: `expected type parameter`
|
||||||
|
INT_NUMBER@[9; 11)
|
||||||
|
WHITESPACE@[11; 12)
|
||||||
|
err: `expected COMMA`
|
||||||
|
err: `expected R_ANGLE`
|
||||||
|
err: `expected `;`, `{`, or `(``
|
||||||
|
ERROR@[12; 14)
|
||||||
|
err: `expected item`
|
||||||
|
PLUS@[12; 13)
|
||||||
|
WHITESPACE@[13; 14)
|
||||||
|
ERROR@[14; 15)
|
||||||
|
err: `expected item`
|
||||||
|
INT_NUMBER@[14; 15)
|
||||||
|
ERROR@[15; 17)
|
||||||
|
err: `expected item`
|
||||||
|
R_ANGLE@[15; 16)
|
||||||
|
WHITESPACE@[16; 17)
|
||||||
|
ERROR@[17; 33)
|
||||||
|
err: `expected item`
|
||||||
|
L_CURLY@[17; 18)
|
||||||
|
WHITESPACE@[18; 23)
|
||||||
|
IDENT@[23; 24)
|
||||||
|
COLON@[24; 25)
|
||||||
|
WHITESPACE@[25; 26)
|
||||||
|
IDENT@[26; 29)
|
||||||
|
WHITESPACE@[29; 30)
|
||||||
|
R_CURLY@[30; 31)
|
||||||
|
WHITESPACE@[31; 33)
|
||||||
|
STRUCT_ITEM@[33; 43)
|
||||||
|
STRUCT_KW@[33; 39)
|
||||||
|
WHITESPACE@[39; 40)
|
||||||
|
IDENT@[40; 41)
|
||||||
|
SEMI@[41; 42)
|
||||||
|
WHITESPACE@[42; 43)
|
Loading…
Reference in a new issue