about summary refs log tree commit diff
path: root/src/librustdoc/astsrv.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/astsrv.rs')
-rw-r--r--src/librustdoc/astsrv.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/librustdoc/astsrv.rs b/src/librustdoc/astsrv.rs
index 6d7d7911468..b20d8cab2a4 100644
--- a/src/librustdoc/astsrv.rs
+++ b/src/librustdoc/astsrv.rs
@@ -51,11 +51,11 @@ pub struct Srv {
 }
 
 pub fn from_str<T>(source: ~str, owner: SrvOwner<T>) -> T {
-    run(owner, copy source, parse::from_str_sess)
+    run(owner, source.clone(), parse::from_str_sess)
 }
 
 pub fn from_file<T>(file: ~str, owner: SrvOwner<T>) -> T {
-    run(owner, copy file, |sess, f| parse::from_file_sess(sess, &Path(f)))
+    run(owner, file.clone(), |sess, f| parse::from_file_sess(sess, &Path(f)))
 }
 
 fn run<T>(owner: SrvOwner<T>, source: ~str, parse: Parser) -> T {
@@ -117,7 +117,8 @@ fn build_ctxt(sess: Session,
                                                      copy sess.opts.cfg, ast);
     let ast = config::strip_unconfigured_items(ast);
     let ast = syntax::ext::expand::expand_crate(sess.parse_sess,
-                                                copy sess.opts.cfg, ast);
+                                                sess.opts.cfg.clone(),
+                                                ast);
     let ast = front::test::modify_for_testing(sess, ast);
     let ast_map = ast_map::map_crate(sess.diagnostic(), ast);