about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-12-31 09:59:37 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2020-02-13 11:25:34 +0100
commitdc6bd6a12347f27c937c19adfda542f694fb61c5 (patch)
tree423c4ffa369a7b896cec0406f190a70842635e01 /src
parentfcce5fa6e7ba67db63674dc7369125875c7f39a2 (diff)
downloadrust-dc6bd6a12347f27c937c19adfda542f694fb61c5.tar.gz
rust-dc6bd6a12347f27c937c19adfda542f694fb61c5.zip
expand: simplify flat_map_item
Diffstat (limited to 'src')
-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);