about summary refs log tree commit diff
path: root/src/rustdoc/astsrv.rs
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-04-30 11:52:07 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-04-30 11:52:07 -0700
commit85fbfa25d799c98a0aadf2faef3fc17400764daf (patch)
tree929d32253cfdbb303dadeecf7433466f6b27214c /src/rustdoc/astsrv.rs
parent2bb3b63ec4379b812aeceb690d78763ec55d3cbb (diff)
downloadrust-85fbfa25d799c98a0aadf2faef3fc17400764daf.tar.gz
rust-85fbfa25d799c98a0aadf2faef3fc17400764daf.zip
Revert "Eliminate a copy in syntax::parse::new_parser_from_file"
This reverts commit 2bb3b63ec4379b812aeceb690d78763ec55d3cbb.

(I was confused.)
Diffstat (limited to 'src/rustdoc/astsrv.rs')
-rw-r--r--src/rustdoc/astsrv.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/rustdoc/astsrv.rs b/src/rustdoc/astsrv.rs
index f1eae1b4619..71716ea059e 100644
--- a/src/rustdoc/astsrv.rs
+++ b/src/rustdoc/astsrv.rs
@@ -36,10 +36,7 @@ type ctxt = {
 
 type srv_owner<T> = fn(srv: srv) -> T;
 type ctxt_handler<T> = fn~(ctxt: ctxt) -> T;
-/* The idea is that a parser takes an input of type U,
-   which lets us have parsers that either take unboxed or
-   boxed strings. */
-type parser<U> = fn~(session::session, U) -> @ast::crate;
+type parser = fn~(session::session, str) -> @ast::crate;
 
 enum msg {
     handle_request(fn~(ctxt)),
@@ -51,14 +48,14 @@ enum srv = {
 };
 
 fn from_str<T>(source: str, owner: srv_owner<T>) -> T {
-    run(owner, ~source, parse::from_str_sess)
+    run(owner, source, parse::from_str_sess)
 }
 
 fn from_file<T>(file: str, owner: srv_owner<T>) -> T {
     run(owner, file, parse::from_file_sess)
 }
 
-fn run<T, U: send>(owner: srv_owner<T>, +source: U, parse: parser<U>) -> T {
+fn run<T>(owner: srv_owner<T>, source: str, parse: parser) -> T {
 
     let srv_ = srv({
         ch: task::spawn_listener {|po|
@@ -71,7 +68,7 @@ fn run<T, U: send>(owner: srv_owner<T>, +source: U, parse: parser<U>) -> T {
     ret res;
 }
 
-fn act<U>(po: comm::port<msg>, source: U, parse: parser<U>) {
+fn act(po: comm::port<msg>, source: str, parse: parser) {
     let (sess, ignore_errors) = build_session();
 
     let ctxt = build_ctxt(