diff options
-rw-r--r-- | crates/ra_hir_def/src/body/lower.rs | 1 | ||||
-rw-r--r-- | crates/ra_syntax/src/ast/generated/nodes.rs | 2 | ||||
-rw-r--r-- | xtask/src/codegen/rust.ungram | 34 |
3 files changed, 18 insertions, 19 deletions
diff --git a/crates/ra_hir_def/src/body/lower.rs b/crates/ra_hir_def/src/body/lower.rs index 25e29b7cd..ef1c0df01 100644 --- a/crates/ra_hir_def/src/body/lower.rs +++ b/crates/ra_hir_def/src/body/lower.rs | |||
@@ -786,7 +786,6 @@ impl ExprCollector<'_> { | |||
786 | ast::Pat::PlaceholderPat(_) => Pat::Wild, | 786 | ast::Pat::PlaceholderPat(_) => Pat::Wild, |
787 | ast::Pat::RecordPat(p) => { | 787 | ast::Pat::RecordPat(p) => { |
788 | let path = p.path().and_then(|path| self.expander.parse_path(path)); | 788 | let path = p.path().and_then(|path| self.expander.parse_path(path)); |
789 | |||
790 | let args: Vec<_> = p | 789 | let args: Vec<_> = p |
791 | .record_pat_field_list() | 790 | .record_pat_field_list() |
792 | .expect("every struct should have a field list") | 791 | .expect("every struct should have a field list") |
diff --git a/crates/ra_syntax/src/ast/generated/nodes.rs b/crates/ra_syntax/src/ast/generated/nodes.rs index 7708ae806..713aebcfa 100644 --- a/crates/ra_syntax/src/ast/generated/nodes.rs +++ b/crates/ra_syntax/src/ast/generated/nodes.rs | |||
@@ -1128,7 +1128,7 @@ pub struct BoxPat { | |||
1128 | } | 1128 | } |
1129 | impl BoxPat { | 1129 | impl BoxPat { |
1130 | pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) } | 1130 | pub fn box_token(&self) -> Option<SyntaxToken> { support::token(&self.syntax, T![box]) } |
1131 | pub fn path(&self) -> Option<Path> { support::child(&self.syntax) } | 1131 | pub fn pat(&self) -> Option<Pat> { support::child(&self.syntax) } |
1132 | } | 1132 | } |
1133 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] | 1133 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
1134 | pub struct DotDotPat { | 1134 | pub struct DotDotPat { |
diff --git a/xtask/src/codegen/rust.ungram b/xtask/src/codegen/rust.ungram index 643668863..cb8a307fe 100644 --- a/xtask/src/codegen/rust.ungram +++ b/xtask/src/codegen/rust.ungram | |||
@@ -516,8 +516,8 @@ Pat = | |||
516 | LiteralPat = | 516 | LiteralPat = |
517 | Literal | 517 | Literal |
518 | 518 | ||
519 | PathPat = | 519 | BindPat = |
520 | Path | 520 | Attr* 'ref'? 'mut'? Name ('@' Pat)? |
521 | 521 | ||
522 | PlaceholderPat = | 522 | PlaceholderPat = |
523 | '_' | 523 | '_' |
@@ -540,29 +540,29 @@ RecordPatFieldList = | |||
540 | RecordPatField = | 540 | RecordPatField = |
541 | Attr* (NameRef ':')? Pat | 541 | Attr* (NameRef ':')? Pat |
542 | 542 | ||
543 | OrPat = | 543 | TupleStructPat = |
544 | Pat* | 544 | Path '(' args:(Pat (',' Pat)* ','?)? ')' |
545 | |||
546 | TuplePat = | ||
547 | '(' args:(Pat (',' Pat)* ','?)? ')' | ||
545 | 548 | ||
546 | ParenPat = | 549 | ParenPat = |
547 | '(' Pat ')' | 550 | '(' Pat ')' |
548 | 551 | ||
549 | BoxPat = | 552 | SlicePat = |
550 | 'box' Path | 553 | '[' args:(Pat (',' Pat)* ','?)? ']' |
551 | 554 | ||
552 | BindPat = | 555 | PathPat = |
553 | Attr* 'ref'? 'mut'? Name ('@' Pat)? | 556 | Path |
557 | |||
558 | OrPat = | ||
559 | (Pat ('|' Pat)* '|'?) | ||
560 | |||
561 | BoxPat = | ||
562 | 'box' Pat | ||
554 | 563 | ||
555 | DotDotPat = | 564 | DotDotPat = |
556 | '..' | 565 | '..' |
557 | 566 | ||
558 | SlicePat = | ||
559 | '[' args:Pat* ']' | ||
560 | |||
561 | MacroPat = | 567 | MacroPat = |
562 | MacroCall | 568 | MacroCall |
563 | |||
564 | TupleStructPat = | ||
565 | Path '(' args:Pat* ')' | ||
566 | |||
567 | TuplePat = | ||
568 | '(' args:Pat* ')' | ||