Skip to content

Commit de57dbc

Browse files
committed
Use pre-interned symbols in import recovery
1 parent f6484fa commit de57dbc

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

compiler/rustc_parse/src/parser/item.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,7 @@ impl<'a> Parser<'a> {
271271
// MACRO_RULES ITEM
272272
self.parse_item_macro_rules(vis, has_bang)?
273273
} else if self.isnt_macro_invocation()
274-
&& (self.token.is_ident_named(Symbol::intern("import"))
275-
|| self.token.is_ident_named(Symbol::intern("using")))
274+
&& (self.token.is_ident_named(sym::import) || self.token.is_ident_named(sym::using))
276275
{
277276
return self.recover_import_as_use();
278277
} else if self.isnt_macro_invocation() && vis.kind.is_pub() {

compiler/rustc_span/src/symbol.rs

+2
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,7 @@ symbols! {
782782
impl_lint_pass,
783783
impl_macros,
784784
impl_trait_in_bindings,
785+
import,
785786
import_shadowing,
786787
imported_main,
787788
in_band_lifetimes,
@@ -1519,6 +1520,7 @@ symbols! {
15191520
use_nested_groups,
15201521
used,
15211522
used_with_arg,
1523+
using,
15221524
usize,
15231525
v1,
15241526
va_arg,

0 commit comments

Comments
 (0)