about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/test.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs
index 9975e25f493..7fb8cdde311 100644
--- a/src/libsyntax/test.rs
+++ b/src/libsyntax/test.rs
@@ -202,8 +202,8 @@ impl fold::Folder for EntryPointCleaner {
         let folded = fold::noop_fold_item(i, self).expect_one("noop did something");
         self.depth -= 1;
 
-        // Remove any #[main] from the AST so it doesn't clash with
-        // the one we're going to add, but mark it as
+        // Remove any #[main] or #[start] from the AST so it doesn't
+        // clash with the one we're going to add, but mark it as
         // #[allow(dead_code)] to avoid printing warnings.
         let folded = match entry::entry_point_type(&*folded, self.depth) {
             EntryPointType::MainNamed |
@@ -221,13 +221,10 @@ impl fold::Folder for EntryPointCleaner {
                     ast::Item {
                         id: id,
                         ident: ident,
-                        attrs: attrs.into_iter().filter_map(|attr| {
-                            if !attr.check_name("main") {
-                                Some(attr)
-                            } else {
-                                None
-                            }
-                        })
+                        attrs: attrs.into_iter()
+                            .filter(|attr| {
+                                !attr.check_name("main") && !attr.check_name("start")
+                            })
                             .chain(iter::once(allow_dead_code))
                             .collect(),
                         node: node,