diff options
| author | Keegan McAllister <kmcallister@mozilla.com> | 2014-12-09 22:53:12 -0800 |
|---|---|---|
| committer | Keegan McAllister <kmcallister@mozilla.com> | 2015-01-05 11:38:12 -0800 |
| commit | e2a9c04e192926fde1a8e886b55e4c2b6e0e56cb (patch) | |
| tree | 6a0e56d493460f967b6475bb287a197c990fd830 /src/libsyntax/parse | |
| parent | ad7c64777380a780b42028855ad0d09932a11623 (diff) | |
| download | rust-e2a9c04e192926fde1a8e886b55e4c2b6e0e56cb.tar.gz rust-e2a9c04e192926fde1a8e886b55e4c2b6e0e56cb.zip | |
Allow leading :: in use items
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f513692c31d..62bda20473f 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -5973,6 +5973,10 @@ impl<'a> Parser<'a> { fn parse_view_path(&mut self) -> P<ViewPath> { let lo = self.span.lo; + // Allow a leading :: because the paths are absolute either way. + // This occurs with "use $crate::..." in macros. + self.eat(&token::ModSep); + if self.check(&token::OpenDelim(token::Brace)) { // use {foo,bar} let idents = self.parse_unspanned_seq( |
