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.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs
index 991ab77419f..2a47a696b1c 100644
--- a/src/libsyntax/test.rs
+++ b/src/libsyntax/test.rs
@@ -144,9 +144,10 @@ impl<'a> fold::Folder for TestHarnessGenerator<'a> {
                     // Make all tests public so we can call them from outside
                     // the module (note that the tests are re-exported and must
                     // be made public themselves to avoid privacy errors).
-                    let mut result = (*i).clone();
-                    result.vis = ast::Public;
-                    P(result)
+                    i.map(|mut i| {
+                        i.vis = ast::Public;
+                        i
+                    })
                 }
             }
         } else {