Skip to content

Commit 8456dba

Browse files
committed
Fix spans for predicates in where clauses
1 parent 5910dc0 commit 8456dba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libsyntax/parse/parser.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -3882,7 +3882,7 @@ impl<'a> Parser<'a> {
38823882
let bounds =
38833883
try!(self.parse_lifetimes(token::BinOp(token::Plus)));
38843884

3885-
let hi = self.span.hi;
3885+
let hi = self.last_span.hi;
38863886
let span = mk_sp(lo, hi);
38873887

38883888
where_clause.predicates.push(ast::WherePredicate::RegionPredicate(
@@ -3911,7 +3911,7 @@ impl<'a> Parser<'a> {
39113911

39123912
if try!(self.eat(&token::Colon) ){
39133913
let bounds = try!(self.parse_ty_param_bounds(BoundParsingMode::Bare));
3914-
let hi = self.span.hi;
3914+
let hi = self.last_span.hi;
39153915
let span = mk_sp(lo, hi);
39163916

39173917
if bounds.is_empty() {
@@ -3931,7 +3931,7 @@ impl<'a> Parser<'a> {
39313931
parsed_something = true;
39323932
} else if try!(self.eat(&token::Eq) ){
39333933
// let ty = try!(self.parse_ty_nopanic());
3934-
let hi = self.span.hi;
3934+
let hi = self.last_span.hi;
39353935
let span = mk_sp(lo, hi);
39363936
// where_clause.predicates.push(
39373937
// ast::WherePredicate::EqPredicate(ast::WhereEqPredicate {

0 commit comments

Comments
 (0)