diff options
| author | Matthew Jasper <mjjasper1@gmail.com> | 2019-03-30 22:54:29 +0000 |
|---|---|---|
| committer | Matthew Jasper <mjjasper1@gmail.com> | 2019-05-21 19:37:38 +0100 |
| commit | 4bfb0453f537b2927574f29bdf90c9a22ea98add (patch) | |
| tree | 9b1cef2e6ae38d055ee3a31f2dee48c25264030e /src/libsyntax/parse | |
| parent | 615c23f6ecc07e87501f2f52190e3fb08b50a17e (diff) | |
| download | rust-4bfb0453f537b2927574f29bdf90c9a22ea98add.tar.gz rust-4bfb0453f537b2927574f29bdf90c9a22ea98add.zip | |
Give match arms an HirId and a Span
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 24d120376de..ba36783e11e 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3946,6 +3946,7 @@ impl<'a> Parser<'a> { crate fn parse_arm(&mut self) -> PResult<'a, Arm> { let attrs = self.parse_outer_attributes()?; + let lo = self.span; let pats = self.parse_pats()?; let guard = if self.eat_keyword(keywords::If) { Some(Guard::If(self.parse_expr()?)) @@ -3965,6 +3966,8 @@ impl<'a> Parser<'a> { let require_comma = classify::expr_requires_semi_to_be_stmt(&expr) && self.token != token::CloseDelim(token::Brace); + let hi = self.span; + if require_comma { let cm = self.sess.source_map(); self.expect_one_of(&[token::Comma], &[token::CloseDelim(token::Brace)]) @@ -4008,6 +4011,7 @@ impl<'a> Parser<'a> { pats, guard, body: expr, + span: lo.to(hi), }) } |
