rustdoc: Don't treat "super" specially for urls
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
This commit is contained in:
@@ -115,12 +115,7 @@ impl fmt::Default for clean::Path {
|
|||||||
fn resolved_path(w: &mut io::Writer, id: ast::NodeId, p: &clean::Path,
|
fn resolved_path(w: &mut io::Writer, id: ast::NodeId, p: &clean::Path,
|
||||||
print_all: bool) {
|
print_all: bool) {
|
||||||
path(w, p, print_all,
|
path(w, p, print_all,
|
||||||
|_cache, loc| {
|
|_cache, loc| { Some("../".repeat(loc.len())) },
|
||||||
match p.segments[0].name.as_slice() {
|
|
||||||
"super" => Some("../".repeat(loc.len() - 1)),
|
|
||||||
_ => Some("../".repeat(loc.len())),
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|cache| {
|
|cache| {
|
||||||
match cache.paths.find(&id) {
|
match cache.paths.find(&id) {
|
||||||
None => None,
|
None => None,
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ use std::rt::io::file::{FileInfo, DirectoryInfo};
|
|||||||
use std::rt::io::file;
|
use std::rt::io::file;
|
||||||
use std::rt::io;
|
use std::rt::io;
|
||||||
use std::rt::io::Reader;
|
use std::rt::io::Reader;
|
||||||
|
use std::os;
|
||||||
use std::str;
|
use std::str;
|
||||||
use std::task;
|
use std::task;
|
||||||
use std::unstable::finally::Finally;
|
use std::unstable::finally::Finally;
|
||||||
@@ -686,7 +687,15 @@ impl Context {
|
|||||||
Process(Context, clean::Item),
|
Process(Context, clean::Item),
|
||||||
}
|
}
|
||||||
enum Progress { JobNew, JobDone }
|
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() {
|
let mut item = match crate.module.take() {
|
||||||
Some(i) => i,
|
Some(i) => i,
|
||||||
@@ -706,7 +715,7 @@ impl Context {
|
|||||||
// using the same channel/port. Through this, the crate is recursed on
|
// using the same channel/port. Through this, the crate is recursed on
|
||||||
// in a hierarchical fashion, and parallelization is only achieved if
|
// in a hierarchical fashion, and parallelization is only achieved if
|
||||||
// one node in the hierarchy has more than one child (very common).
|
// 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 port = port.clone();
|
||||||
let chan = chan.clone();
|
let chan = chan.clone();
|
||||||
let prog_chan = prog_chan.clone();
|
let prog_chan = prog_chan.clone();
|
||||||
@@ -761,7 +770,7 @@ impl Context {
|
|||||||
if jobs == 0 { break }
|
if jobs == 0 { break }
|
||||||
}
|
}
|
||||||
|
|
||||||
for _ in range(0, WORKERS) {
|
for _ in range(0, workers) {
|
||||||
chan.send(Die);
|
chan.send(Die);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user