Add parsing for builtin # in expression and item context
This commit is contained in:
parent
4b94c23219
commit
59ecbd2cea
8 changed files with 96 additions and 1 deletions
|
@ -90,7 +90,11 @@ impl<'a> Parser<'a> {
|
|||
attrs,
|
||||
errors::InvalidVariableDeclarationSub::UseLetNotVar,
|
||||
)?
|
||||
} else if self.check_path() && !self.token.is_qpath_start() && !self.is_path_start_item() {
|
||||
} else if self.check_path()
|
||||
&& !self.token.is_qpath_start()
|
||||
&& !self.is_path_start_item()
|
||||
&& !self.is_builtin()
|
||||
{
|
||||
// We have avoided contextual keywords like `union`, items with `crate` visibility,
|
||||
// or `auto trait` items. We aim to parse an arbitrary path `a::b` but not something
|
||||
// that starts like a path (1 token), but it fact not a path.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue