about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/deriving/custom.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/libsyntax_ext/deriving/custom.rs b/src/libsyntax_ext/deriving/custom.rs
index 974e86a5741..a7e2d82bb97 100644
--- a/src/libsyntax_ext/deriving/custom.rs
+++ b/src/libsyntax_ext/deriving/custom.rs
@@ -107,12 +107,10 @@ impl MultiItemModifier for ProcMacroDerive {
             }
         });
 
-        let mut res = vec![Annotatable::Item(item)];
         // Reassign spans of all expanded items to the input `item`
         // for better errors here.
-        res.extend(new_items.into_iter().flat_map(|item| {
-            ChangeSpan { span: span }.fold_item(item)
-        }).map(Annotatable::Item));
-        res
+        new_items.into_iter().map(|item| {
+            Annotatable::Item(ChangeSpan { span: span }.fold_item(item).expect_one(""))
+        }).collect()
     }
 }