rollup merge of #21845: Potpourri/import-syntax

syntax like `use foo::bar::;` and `use foo:: as bar;` should be rejected, see issue #21629
This commit is contained in:
Alex Crichton
2015-02-02 11:01:17 -08:00
3 changed files with 30 additions and 3 deletions

View File

@@ -5917,9 +5917,9 @@ impl<'a> Parser<'a> {
self.bump();
match self.token {
token::Ident(i, _) => {
self.bump();
path.push(i);
token::Ident(..) => {
let ident = self.parse_ident();
path.push(ident);
}
// foo::bar::{a,b,c}
@@ -5959,6 +5959,11 @@ impl<'a> Parser<'a> {
return P(spanned(lo, self.span.hi, ViewPathGlob(path)));
}
// fall-through for case foo::bar::;
token::Semi => {
self.span_err(self.span, "expected identifier or `{` or `*`, found `;`");
}
_ => break
}
}