auto merge of #9525 : klutzy/rust/obsolete-span-fix, r=alexcrichton

This commit is contained in:
bors 2013-09-26 22:11:14 -07:00
commit eb3ebb7ebd

View File

@ -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 {
@ -1213,14 +1214,16 @@ impl Parser {
// parse an optional, obsolete argument mode.
pub fn parse_arg_mode(&self) {
if self.eat(&token::BINOP(token::MINUS)) {
self.obsolete(*self.span, ObsoleteMode);
self.obsolete(*self.last_span, ObsoleteMode);
} else if self.eat(&token::ANDAND) {
self.obsolete(*self.span, ObsoleteMode);
self.obsolete(*self.last_span, ObsoleteMode);
} else if self.eat(&token::BINOP(token::PLUS)) {
let lo = self.last_span.lo;
if self.eat(&token::BINOP(token::PLUS)) {
self.obsolete(*self.span, ObsoleteMode);
let hi = self.last_span.hi;
self.obsolete(mk_sp(lo, hi), ObsoleteMode);
} else {
self.obsolete(*self.span, ObsoleteMode);
self.obsolete(*self.last_span, ObsoleteMode);
}
} else {
// Ignore.
@ -3865,7 +3868,7 @@ impl Parser {
let mut meths = ~[];
if self.eat(&token::SEMI) {
self.obsolete(*self.span, ObsoleteEmptyImpl);
self.obsolete(*self.last_span, ObsoleteEmptyImpl);
} else {
self.expect(&token::LBRACE);
while !self.eat(&token::RBRACE) {