Skip to content

Commit fc44a9c

Browse files
committed
syntax: Fix wrong span on trait fn visibility
Fixes #9348.
1 parent a56e2ee commit fc44a9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,7 @@ impl Parser {
922922
let attrs = p.parse_outer_attributes();
923923
let lo = p.span.lo;
924924

925+
let vis_span = *self.span;
925926
let vis = p.parse_visibility();
926927
let pur = p.parse_fn_purity();
927928
// NB: at the moment, trait methods are public by default; this
@@ -947,7 +948,7 @@ impl Parser {
947948
// NB: at the moment, visibility annotations on required
948949
// methods are ignored; this could change.
949950
if vis != ast::inherited {
950-
self.obsolete(*self.last_span,
951+
self.obsolete(vis_span,
951952
ObsoleteTraitFuncVisibility);
952953
}
953954
required(TypeMethod {

0 commit comments

Comments
 (0)