Reject syntax like use foo::bar::; and use foo:: as bar; and keywords in view path idents
This commit is contained in:
@@ -5912,9 +5912,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}
|
||||
@@ -5954,6 +5954,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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user