From fc44a9c7dd7203315a47b307c774d22f89d864be Mon Sep 17 00:00:00 2001 From: klutzy Date: Thu, 26 Sep 2013 22:44:45 +0900 Subject: syntax: Fix wrong span on trait fn visibility Fixes #9348. --- src/libsyntax/parse/parser.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libsyntax') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 10393fc8624..e604384c259 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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 @@ -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 { -- cgit 1.4.1-3-g733a5