mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Parse tuple struct field initialization
This commit is contained in:
parent
2fbec23d99
commit
957b5ed23a
4 changed files with 31 additions and 8 deletions
|
@ -572,6 +572,7 @@ fn path_expr(p: &mut Parser, r: Restrictions) -> (CompletedMarker, BlockLike) {
|
|||
// S {};
|
||||
// S { x, y: 32, };
|
||||
// S { x, y: 32, ..Default::default() };
|
||||
// TupleStruct { 0: 1 };
|
||||
// }
|
||||
pub(crate) fn named_field_list(p: &mut Parser) {
|
||||
assert!(p.at(T!['{']));
|
||||
|
@ -583,7 +584,7 @@ pub(crate) fn named_field_list(p: &mut Parser) {
|
|||
// fn main() {
|
||||
// S { #[cfg(test)] field: 1 }
|
||||
// }
|
||||
IDENT | T![#] => {
|
||||
IDENT | INT_NUMBER | T![#] => {
|
||||
let m = p.start();
|
||||
attributes::outer_attributes(p);
|
||||
name_ref(p);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue