Use pre-interned symbols in import recovery

This commit is contained in:
bjorn3 2022-06-28 17:34:52 +00:00
parent f6484fa9b5
commit de57dbcefd
2 changed files with 3 additions and 2 deletions

View File

@ -271,8 +271,7 @@ impl<'a> Parser<'a> {
// MACRO_RULES ITEM
self.parse_item_macro_rules(vis, has_bang)?
} else if self.isnt_macro_invocation()
&& (self.token.is_ident_named(Symbol::intern("import"))
|| self.token.is_ident_named(Symbol::intern("using")))
&& (self.token.is_ident_named(sym::import) || self.token.is_ident_named(sym::using))
{
return self.recover_import_as_use();
} else if self.isnt_macro_invocation() && vis.kind.is_pub() {

View File

@ -782,6 +782,7 @@ symbols! {
impl_lint_pass,
impl_macros,
impl_trait_in_bindings,
import,
import_shadowing,
imported_main,
in_band_lifetimes,
@ -1519,6 +1520,7 @@ symbols! {
use_nested_groups,
used,
used_with_arg,
using,
usize,
v1,
va_arg,