Allow leading :: in use items

This commit is contained in:
Keegan McAllister
2014-12-09 22:53:12 -08:00
parent ad7c647773
commit e2a9c04e19
3 changed files with 45 additions and 0 deletions

View File

@@ -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(