StructField span should include pub

This commit is contained in:
Chris Hellmuth 2015-06-07 16:34:03 -06:00
parent dc1e79b3c2
commit a72283832d

View File

@ -3395,7 +3395,10 @@ fn parse_let(&mut self) -> PResult<P<Decl>> {
/// 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"));
}