mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
Remove high-order bits from tuple struct
This commit is contained in:
parent
05ad469ac3
commit
645a1b5d73
3 changed files with 34 additions and 6 deletions
|
@ -127,18 +127,21 @@ fn pos_fields(p: &mut Parser) {
|
|||
if !p.expect(L_PAREN) {
|
||||
return;
|
||||
}
|
||||
comma_list(p, R_PAREN, |p| {
|
||||
pos_field(p);
|
||||
true
|
||||
});
|
||||
p.expect(R_PAREN);
|
||||
loop {
|
||||
if p.at(R_PAREN) || p.at(EOF) {
|
||||
break;
|
||||
}
|
||||
|
||||
fn pos_field(p: &mut Parser) {
|
||||
let pos_field = p.start();
|
||||
visibility(p);
|
||||
types::type_ref(p);
|
||||
pos_field.complete(p, POS_FIELD);
|
||||
|
||||
if !p.at(R_PAREN) {
|
||||
p.expect(COMMA);
|
||||
}
|
||||
}
|
||||
p.expect(R_PAREN);
|
||||
}
|
||||
|
||||
fn generic_parameters(_: &mut Parser) {}
|
||||
|
|
2
tests/data/parser/ok/0017_attr_trailing_comma.rs
Normal file
2
tests/data/parser/ok/0017_attr_trailing_comma.rs
Normal file
|
@ -0,0 +1,2 @@
|
|||
#[foo(a,)]
|
||||
fn foo() {}
|
23
tests/data/parser/ok/0017_attr_trailing_comma.txt
Normal file
23
tests/data/parser/ok/0017_attr_trailing_comma.txt
Normal file
|
@ -0,0 +1,23 @@
|
|||
FILE@[0; 23)
|
||||
FN_ITEM@[0; 23)
|
||||
ATTR@[0; 11)
|
||||
POUND@[0; 1)
|
||||
L_BRACK@[1; 2)
|
||||
META_ITEM@[2; 9)
|
||||
IDENT@[2; 5)
|
||||
L_PAREN@[5; 6)
|
||||
META_ITEM@[6; 7)
|
||||
IDENT@[6; 7)
|
||||
COMMA@[7; 8)
|
||||
R_PAREN@[8; 9)
|
||||
R_BRACK@[9; 10)
|
||||
WHITESPACE@[10; 11)
|
||||
FN_KW@[11; 13)
|
||||
WHITESPACE@[13; 14)
|
||||
IDENT@[14; 17)
|
||||
L_PAREN@[17; 18)
|
||||
R_PAREN@[18; 19)
|
||||
WHITESPACE@[19; 20)
|
||||
L_CURLY@[20; 21)
|
||||
R_CURLY@[21; 22)
|
||||
WHITESPACE@[22; 23)
|
Loading…
Reference in a new issue