]> git.lizzy.rs Git - rust.git/commitdiff
Fix spans for predicates in where clauses
authorNick Cameron <ncameron@mozilla.com>
Wed, 22 Apr 2015 06:29:54 +0000 (18:29 +1200)
committerNick Cameron <ncameron@mozilla.com>
Wed, 22 Apr 2015 06:29:54 +0000 (18:29 +1200)
src/libsyntax/parse/parser.rs

index 0515d1ae945bda170e818902f935145042f740ff..d9a560b0eac0686e03301cc9ac1e2cff9e94371e 100644 (file)
@@ -3882,7 +3882,7 @@ pub fn parse_where_clause(&mut self) -> PResult<ast::WhereClause> {
                     let bounds =
                         try!(self.parse_lifetimes(token::BinOp(token::Plus)));
 
-                    let hi = self.span.hi;
+                    let hi = self.last_span.hi;
                     let span = mk_sp(lo, hi);
 
                     where_clause.predicates.push(ast::WherePredicate::RegionPredicate(
@@ -3911,7 +3911,7 @@ pub fn parse_where_clause(&mut self) -> PResult<ast::WhereClause> {
 
                     if try!(self.eat(&token::Colon) ){
                         let bounds = try!(self.parse_ty_param_bounds(BoundParsingMode::Bare));
-                        let hi = self.span.hi;
+                        let hi = self.last_span.hi;
                         let span = mk_sp(lo, hi);
 
                         if bounds.is_empty() {
@@ -3931,7 +3931,7 @@ pub fn parse_where_clause(&mut self) -> PResult<ast::WhereClause> {
                         parsed_something = true;
                     } else if try!(self.eat(&token::Eq) ){
                         // let ty = try!(self.parse_ty_nopanic());
-                        let hi = self.span.hi;
+                        let hi = self.last_span.hi;
                         let span = mk_sp(lo, hi);
                         // where_clause.predicates.push(
                         //     ast::WherePredicate::EqPredicate(ast::WhereEqPredicate {