Skip to content

Commit

Permalink
Oops, parse_type_path should be aware of macro-generated paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
bblum committed Jun 21, 2013
1 parent c2510fd commit 3e0a5b9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1050,11 +1050,13 @@ impl Parser {
// Like the above, but can also parse kind bounds in the case of a
// path to be used as a type that might be a trait.
pub fn parse_type_path(&self) -> (@ast::Path, OptVec<TyParamBound>) {
let mut bounds = None;
let mut bounds = opt_vec::Empty;
let path = self.parse_bounded_path_with_tps(false, Some(|| {
bounds = Some(self.parse_optional_ty_param_bounds());
// Note: this closure might not even get called in the case of a
// macro-generated path. But that's the macro parser's job.
bounds = self.parse_optional_ty_param_bounds();
}));
(path, bounds.unwrap())
(path, bounds)
}

/// parses 0 or 1 lifetime
Expand Down

2 comments on commit 3e0a5b9

@graydon
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+ this is fine

@Aatch
Copy link

@Aatch Aatch commented on 3e0a5b9 Jun 22, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

p=10

Bumping priority because I plan on doing a snapshot soon.

Please sign in to comment.