about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-06-08 14:35:27 +0000
committerbors <bors@rust-lang.org>2015-06-08 14:35:27 +0000
commit61c43b47338b92c447c1f6af5cffec46718e750b (patch)
tree965cad6792ce32ccba94cc2950c2658bf5d29cc1 /src/libsyntax/parse
parent115121de3d4669a798e99aa69dfdbc7012b4181c (diff)
parent905727246a38d72d6df7608ca976e1880ddc6a85 (diff)
downloadrust-61c43b47338b92c447c1f6af5cffec46718e750b.tar.gz
rust-61c43b47338b92c447c1f6af5cffec46718e750b.zip
Auto merge of #26091 - chellmuth:pub-struct-field-span, r=nrc
Issue: #26083 

Re-submitting https://github.com/rust-lang/rust/pull/26084

r? @nrc 
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 420b27b8395..dcf6667b606 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3394,7 +3394,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"));
         }