Use pre-interned symbols in import recovery
This commit is contained in:
parent
f6484fa9b5
commit
de57dbcefd
2 changed files with 3 additions and 2 deletions
|
@ -271,8 +271,7 @@ impl<'a> Parser<'a> {
|
||||||
// MACRO_RULES ITEM
|
// MACRO_RULES ITEM
|
||||||
self.parse_item_macro_rules(vis, has_bang)?
|
self.parse_item_macro_rules(vis, has_bang)?
|
||||||
} else if self.isnt_macro_invocation()
|
} else if self.isnt_macro_invocation()
|
||||||
&& (self.token.is_ident_named(Symbol::intern("import"))
|
&& (self.token.is_ident_named(sym::import) || self.token.is_ident_named(sym::using))
|
||||||
|| self.token.is_ident_named(Symbol::intern("using")))
|
|
||||||
{
|
{
|
||||||
return self.recover_import_as_use();
|
return self.recover_import_as_use();
|
||||||
} else if self.isnt_macro_invocation() && vis.kind.is_pub() {
|
} else if self.isnt_macro_invocation() && vis.kind.is_pub() {
|
||||||
|
|
|
@ -782,6 +782,7 @@ symbols! {
|
||||||
impl_lint_pass,
|
impl_lint_pass,
|
||||||
impl_macros,
|
impl_macros,
|
||||||
impl_trait_in_bindings,
|
impl_trait_in_bindings,
|
||||||
|
import,
|
||||||
import_shadowing,
|
import_shadowing,
|
||||||
imported_main,
|
imported_main,
|
||||||
in_band_lifetimes,
|
in_band_lifetimes,
|
||||||
|
@ -1519,6 +1520,7 @@ symbols! {
|
||||||
use_nested_groups,
|
use_nested_groups,
|
||||||
used,
|
used,
|
||||||
used_with_arg,
|
used_with_arg,
|
||||||
|
using,
|
||||||
usize,
|
usize,
|
||||||
v1,
|
v1,
|
||||||
va_arg,
|
va_arg,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue