We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c637cab commit a95c71eCopy full SHA for a95c71e
src/libsyntax/ext/expand.rs
@@ -412,12 +412,19 @@ pub fn expand_item(it: P<ast::Item>, fld: &mut MacroExpander)
412
let mut new_items = match it.node {
413
ast::ItemMac(..) => expand_item_mac(it, fld),
414
ast::ItemMod(_) | ast::ItemForeignMod(_) => {
415
- fld.cx.mod_push(it.ident);
+ let valid_ident =
416
+ it.ident.name != parse::token::special_idents::invalid.name;
417
+
418
+ if valid_ident {
419
+ fld.cx.mod_push(it.ident);
420
+ }
421
let macro_escape = contains_macro_escape(new_attrs.as_slice());
422
let result = with_exts_frame!(fld.cx.syntax_env,
423
macro_escape,
424
noop_fold_item(it, fld));
- fld.cx.mod_pop();
425
426
+ fld.cx.mod_pop();
427
428
result
429
},
430
_ => {
0 commit comments