diff options
| author | Chris Hellmuth <chellmuth@gmail.com> | 2015-06-07 16:34:03 -0600 |
|---|---|---|
| committer | Chris Hellmuth <chellmuth@gmail.com> | 2015-06-07 16:34:03 -0600 |
| commit | a72283832d3e64fb09fd4e6243c22c72cccd8779 (patch) | |
| tree | 53ea484ab426968745d61c46a679587c26fff945 /src/libsyntax/parse/parser.rs | |
| parent | dc1e79b3c215ac71285f468ed4e7715528e7e9f4 (diff) | |
| download | rust-a72283832d3e64fb09fd4e6243c22c72cccd8779.tar.gz rust-a72283832d3e64fb09fd4e6243c22c72cccd8779.zip | |
StructField span should include `pub`
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 539d594cb8b..6cfa6c05701 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3395,7 +3395,10 @@ impl<'a> Parser<'a> { /// Parse a structure field fn parse_name_and_ty(&mut self, pr: Visibility, attrs: Vec<Attribute> ) -> PResult<StructField> { - let lo = self.span.lo; + let lo = match pr { + Inherited => self.span.lo, + Public => self.last_span.lo, + }; if !self.token.is_plain_ident() { return Err(self.fatal("expected ident")); } |
