1
Fork 0

Add parsing for builtin # in expression and item context

This commit is contained in:
est31 2023-01-19 10:24:17 +01:00
parent 4b94c23219
commit 59ecbd2cea
8 changed files with 96 additions and 1 deletions

View file

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