about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-10-17 18:01:22 -0700
committerbors <bors@rust-lang.org>2013-10-17 18:01:22 -0700
commit51709fcedcc264056587ece3759b3b591c268d0e (patch)
treed5a2ed6385c36ecb8e69c17998b014a0c31ec6fb
parent532ab94c4b5e1f111cbf75d4aa20c78a88759b2e (diff)
parentcf844abced94b74913985c7cffb6bd0b9a9b3445 (diff)
downloadrust-51709fcedcc264056587ece3759b3b591c268d0e.tar.gz
rust-51709fcedcc264056587ece3759b3b591c268d0e.zip
auto merge of #9916 : alexcrichton/rust/issue-9861, r=brson
This was just incorrectly handled before, the path component shouldn't be looked
at at all (we used absolute paths everywhere instead of relative to the current
module location).

Closes #9861
-rw-r--r--src/librustdoc/html/format.rs7
-rw-r--r--src/librustdoc/html/render.rs15
2 files changed, 13 insertions, 9 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 8c1db5aef65..9ff450d4135 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -115,12 +115,7 @@ impl fmt::Default for clean::Path {
 fn resolved_path(w: &mut io::Writer, id: ast::NodeId, p: &clean::Path,
                  print_all: bool) {
     path(w, p, print_all,
-        |_cache, loc| {
-            match p.segments[0].name.as_slice() {
-                "super" => Some("../".repeat(loc.len() - 1)),
-                _ => Some("../".repeat(loc.len())),
-            }
-        },
+        |_cache, loc| { Some("../".repeat(loc.len())) },
         |cache| {
             match cache.paths.find(&id) {
                 None => None,
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs
index b12dd338fff..b81a622fcda 100644
--- a/src/librustdoc/html/render.rs
+++ b/src/librustdoc/html/render.rs
@@ -44,6 +44,7 @@ use std::rt::io::file::{FileInfo, DirectoryInfo};
 use std::rt::io::file;
 use std::rt::io;
 use std::rt::io::Reader;
+use std::os;
 use std::str;
 use std::task;
 use std::unstable::finally::Finally;
@@ -686,7 +687,15 @@ impl Context {
             Process(Context, clean::Item),
         }
         enum Progress { JobNew, JobDone }
-        static WORKERS: int = 10;
+
+        let workers = match os::getenv("RUSTDOC_WORKERS") {
+            Some(s) => {
+                match from_str::<uint>(s) {
+                    Some(n) => n, None => fail2!("{} not a number", s)
+                }
+            }
+            None => 10,
+        };
 
         let mut item = match crate.module.take() {
             Some(i) => i,
@@ -706,7 +715,7 @@ impl Context {
         // using the same channel/port. Through this, the crate is recursed on
         // in a hierarchical fashion, and parallelization is only achieved if
         // one node in the hierarchy has more than one child (very common).
-        for i in range(0, WORKERS) {
+        for i in range(0, workers) {
             let port = port.clone();
             let chan = chan.clone();
             let prog_chan = prog_chan.clone();
@@ -761,7 +770,7 @@ impl Context {
             if jobs == 0 { break }
         }
 
-        for _ in range(0, WORKERS) {
+        for _ in range(0, workers) {
             chan.send(Die);
         }
     }