diff options
| author | Nick Cameron <ncameron@mozilla.com> | 2014-12-27 23:45:50 +1300 |
|---|---|---|
| committer | Nick Cameron <ncameron@mozilla.com> | 2014-12-28 10:28:01 +1300 |
| commit | 35a6f6247ba930425b5ffb8e6f33fbbe1da278cc (patch) | |
| tree | 697ff8bf50a8b2d2e22b1f06130fe59dab8bf6b4 /src/libsyntax/parse/parser.rs | |
| parent | 0201334439393bed205c1148bed425b80aab8c22 (diff) | |
| download | rust-35a6f6247ba930425b5ffb8e6f33fbbe1da278cc.tar.gz rust-35a6f6247ba930425b5ffb8e6f33fbbe1da278cc.zip | |
Fix spans for `use` view statements and their treatment in save-analysis
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 94b61ba56d2..8011507c512 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5917,7 +5917,7 @@ impl<'a> Parser<'a> { } - /// Matches view_path : MOD? IDENT EQ non_global_path + /// Matches view_path : MOD? non_global_path as IDENT /// | MOD? non_global_path MOD_SEP LBRACE RBRACE /// | MOD? non_global_path MOD_SEP LBRACE ident_seq RBRACE /// | MOD? non_global_path MOD_SEP STAR @@ -6029,7 +6029,7 @@ impl<'a> Parser<'a> { } let mut rename_to = path[path.len() - 1u]; let path = ast::Path { - span: mk_sp(lo, self.span.hi), + span: mk_sp(lo, self.last_span.hi), global: false, segments: path.into_iter().map(|identifier| { ast::PathSegment { @@ -6041,7 +6041,8 @@ impl<'a> Parser<'a> { if self.eat_keyword(keywords::As) { rename_to = self.parse_ident() } - P(spanned(lo, self.last_span.hi, + P(spanned(lo, + self.last_span.hi, ViewPathSimple(rename_to, path, ast::DUMMY_NODE_ID))) } |
