about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_expand/expand.rs6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/librustc_expand/expand.rs b/src/librustc_expand/expand.rs
index 91195d379d7..ee0b7fa00de 100644
--- a/src/librustc_expand/expand.rs
+++ b/src/librustc_expand/expand.rs
@@ -1383,11 +1383,7 @@ impl<'a, 'b> MutVisitor for InvocationCollector<'a, 'b> {
                     _ => unreachable!(),
                 })
             }
-            ast::ItemKind::Mod(ast::Mod { inner, .. }) => {
-                if item.ident == Ident::invalid() {
-                    return noop_flat_map_item(item, self);
-                }
-
+            ast::ItemKind::Mod(ast::Mod { inner, .. }) if item.ident != Ident::invalid() => {
                 let orig_directory_ownership = self.cx.current_expansion.directory_ownership;
                 let mut module = (*self.cx.current_expansion.module).clone();
                 module.mod_path.push(item.ident);