Skip to content

Commit 5fbdf3c

Browse files
committed
Fix span bug with >> and type bindings
1 parent 7bf626a commit 5fbdf3c

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/libsyntax/parse/parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3964,7 +3964,7 @@ impl<'a> Parser<'a> {
39643964
p.span_warn(span, "whoops, no =?");
39653965
}
39663966
let ty = try!(p.parse_ty_nopanic());
3967-
let hi = p.span.hi;
3967+
let hi = ty.span.hi;
39683968
let span = mk_sp(lo, hi);
39693969
return Ok(P(TypeBinding{id: ast::DUMMY_NODE_ID,
39703970
ident: ident,
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// Test the type binding span doesn't include >>
12+
13+
use std::ops::Deref;
14+
15+
fn homura<T: Deref<Trget=i32 //~ ERROR associated type
16+
>>(_: T) { }
17+
18+
19+
fn main() {
20+
}

0 commit comments

Comments
 (0)