Skip to content

Commit a722838

Browse files
committed
StructField span should include pub
1 parent dc1e79b commit a722838

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libsyntax/parse/parser.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -3395,7 +3395,10 @@ impl<'a> Parser<'a> {
33953395
/// Parse a structure field
33963396
fn parse_name_and_ty(&mut self, pr: Visibility,
33973397
attrs: Vec<Attribute> ) -> PResult<StructField> {
3398-
let lo = self.span.lo;
3398+
let lo = match pr {
3399+
Inherited => self.span.lo,
3400+
Public => self.last_span.lo,
3401+
};
33993402
if !self.token.is_plain_ident() {
34003403
return Err(self.fatal("expected ident"));
34013404
}

0 commit comments

Comments
 (0)