librustc: Ensure that type parameters are in the right positions in paths.
This removes the stacking of type parameters that occurs when invoking trait methods, and fixes all places in the standard library that were relying on it. It is somewhat awkward in places; I think we'll probably want something like the `Foo::<for T>::new()` syntax.
This commit is contained in:
parent
3b6314c39b
commit
8693943676
70 changed files with 1130 additions and 528 deletions
|
@ -1374,7 +1374,7 @@ impl Parser {
|
|||
_ => None,
|
||||
};
|
||||
match found {
|
||||
Some(INTERPOLATED(token::nt_path(path))) => {
|
||||
Some(INTERPOLATED(token::nt_path(~path))) => {
|
||||
return PathAndBounds {
|
||||
path: path,
|
||||
bounds: None,
|
||||
|
@ -1483,7 +1483,7 @@ impl Parser {
|
|||
let mut path_segments = ~[];
|
||||
let mut bounds = None;
|
||||
let last_segment_index = segments.len() - 1;
|
||||
for (i, segment_and_bounds) in segments.consume_iter().enumerate() {
|
||||
for (i, segment_and_bounds) in segments.move_iter().enumerate() {
|
||||
let PathSegmentAndBoundSet {
|
||||
segment: segment,
|
||||
bound_set: bound_set
|
||||
|
@ -4840,7 +4840,7 @@ impl Parser {
|
|||
let path = ast::Path {
|
||||
span: mk_sp(lo, self.span.hi),
|
||||
global: false,
|
||||
segments: path.consume_iter().transform(|identifier| {
|
||||
segments: path.move_iter().map(|identifier| {
|
||||
ast::PathSegment {
|
||||
identifier: identifier,
|
||||
lifetime: None,
|
||||
|
@ -4876,7 +4876,7 @@ impl Parser {
|
|||
let path = ast::Path {
|
||||
span: mk_sp(lo, self.span.hi),
|
||||
global: false,
|
||||
segments: path.consume_iter().transform(|identifier| {
|
||||
segments: path.move_iter().map(|identifier| {
|
||||
ast::PathSegment {
|
||||
identifier: identifier,
|
||||
lifetime: None,
|
||||
|
@ -4894,7 +4894,7 @@ impl Parser {
|
|||
let path = ast::Path {
|
||||
span: mk_sp(lo, self.span.hi),
|
||||
global: false,
|
||||
segments: path.consume_iter().transform(|identifier| {
|
||||
segments: path.move_iter().map(|identifier| {
|
||||
ast::PathSegment {
|
||||
identifier: identifier,
|
||||
lifetime: None,
|
||||
|
@ -4916,7 +4916,7 @@ impl Parser {
|
|||
let path = ast::Path {
|
||||
span: mk_sp(lo, self.span.hi),
|
||||
global: false,
|
||||
segments: path.consume_iter().transform(|identifier| {
|
||||
segments: path.move_iter().map(|identifier| {
|
||||
ast::PathSegment {
|
||||
identifier: identifier,
|
||||
lifetime: None,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue