Skip to content

Commit

Permalink
syntax: Fix wrong span on trait fn visibility
Browse files Browse the repository at this point in the history
Fixes #9348.
  • Loading branch information
klutzy committed Sep 26, 2013
1 parent a56e2ee commit fc44a9c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,7 @@ impl Parser {
let attrs = p.parse_outer_attributes();
let lo = p.span.lo;

let vis_span = *self.span;
let vis = p.parse_visibility();
let pur = p.parse_fn_purity();
// NB: at the moment, trait methods are public by default; this
Expand All @@ -947,7 +948,7 @@ impl Parser {
// NB: at the moment, visibility annotations on required
// methods are ignored; this could change.
if vis != ast::inherited {
self.obsolete(*self.last_span,
self.obsolete(vis_span,
ObsoleteTraitFuncVisibility);
}
required(TypeMethod {
Expand Down

5 comments on commit fc44a9c

@bors
Copy link
Contributor

@bors bors commented on fc44a9c Sep 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at klutzy@fc44a9c

@bors
Copy link
Contributor

@bors bors commented on fc44a9c Sep 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging klutzy/rust/obsolete-span-fix = fc44a9c into auto

@bors
Copy link
Contributor

@bors bors commented on fc44a9c Sep 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

klutzy/rust/obsolete-span-fix = fc44a9c merged ok, testing candidate = eb3ebb7

@bors
Copy link
Contributor

@bors bors commented on fc44a9c Sep 27, 2013

@bors
Copy link
Contributor

@bors bors commented on fc44a9c Sep 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = eb3ebb7

Please sign in to comment.