Skip to content

Get rustdoc working with std::par instead of its own par library #2902

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/rustdoc/attr_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ fn fold_enum(
let doc = fold::default_seq_fold_enum(fold, doc);

{
variants: do par::anymap(doc.variants) |variant| {
variants: do par::map(doc.variants) |variant| {
let desc = do astsrv::exec(srv) |ctxt| {
alt check ctxt.ast_map.get(doc_id) {
ast_map::node_item(@{
Expand Down Expand Up @@ -206,14 +206,14 @@ fn merge_method_attrs(
ast_map::node_item(@{
node: ast::item_trait(_, methods), _
}, _) {
par::seqmap(methods, |method| {
vec::map(methods, |method| {
(*method.ident, attr_parser::parse_desc(method.attrs))
})
}
ast_map::node_item(@{
node: ast::item_impl(_, _, _, methods), _
}, _) {
par::seqmap(methods, |method| {
vec::map(methods, |method| {
(*method.ident, attr_parser::parse_desc(method.attrs))
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/rustdoc/desc_to_brief_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn fold_trait(fold: fold::fold<()>, doc: doc::traitdoc) -> doc::traitdoc {
let doc =fold::default_seq_fold_trait(fold, doc);

{
methods: par::anymap(doc.methods, |doc| {
methods: par::map(doc.methods, |doc| {
brief: extract(doc.desc)
with doc
})
Expand All @@ -52,7 +52,7 @@ fn fold_impl(fold: fold::fold<()>, doc: doc::impldoc) -> doc::impldoc {
let doc =fold::default_seq_fold_impl(fold, doc);

{
methods: par::anymap(doc.methods, |doc| {
methods: par::map(doc.methods, |doc| {
brief: extract(doc.desc)
with doc
})
Expand Down
8 changes: 4 additions & 4 deletions src/rustdoc/extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ fn nmoddoc_from_mod(
) -> doc::nmoddoc {
{
item: itemdoc,
fns: do par::seqmap(module.items) |item| {
fns: do vec::map(module.items) |item| {
let itemdoc = mk_itemdoc(item.id, item.ident);
alt item.node {
ast::foreign_item_fn(_, _) {
Expand Down Expand Up @@ -159,7 +159,7 @@ fn enumdoc_from_enum(
fn variantdocs_from_variants(
variants: ~[ast::variant]
) -> ~[doc::variantdoc] {
par::seqmap(variants, variantdoc_from_variant)
vec::map(variants, variantdoc_from_variant)
}

fn variantdoc_from_variant(variant: ast::variant) -> doc::variantdoc {
Expand Down Expand Up @@ -189,7 +189,7 @@ fn traitdoc_from_trait(
) -> doc::traitdoc {
{
item: itemdoc,
methods: do par::seqmap(methods) |method| {
methods: do vec::map(methods) |method| {
{
name: *method.ident,
brief: none,
Expand Down Expand Up @@ -221,7 +221,7 @@ fn impldoc_from_impl(
item: itemdoc,
trait_ty: none,
self_ty: none,
methods: do par::seqmap(methods) |method| {
methods: do vec::map(methods) |method| {
{
name: *method.ident,
brief: none,
Expand Down
14 changes: 7 additions & 7 deletions src/rustdoc/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ fn default_par_fold<T:send copy>(ctxt: T) -> fold<T> {

fn default_seq_fold_doc<T>(fold: fold<T>, doc: doc::doc) -> doc::doc {
{
pages: do par::seqmap(doc.pages) |page| {
pages: do vec::map(doc.pages) |page| {
alt page {
doc::cratepage(doc) {
doc::cratepage(fold.fold_crate(fold, doc))
Expand Down Expand Up @@ -169,7 +169,7 @@ fn default_any_fold_mod<T:send copy>(
) -> doc::moddoc {
{
item: fold.fold_item(fold, doc.item),
items: par::anymap(doc.items, |itemtag, copy fold| {
items: par::map(doc.items, |itemtag, copy fold| {
fold_itemtag(fold, itemtag)
})
with doc
Expand All @@ -182,7 +182,7 @@ fn default_seq_fold_mod<T>(
) -> doc::moddoc {
{
item: fold.fold_item(fold, doc.item),
items: par::seqmap(doc.items, |itemtag| {
items: vec::map(doc.items, |itemtag| {
fold_itemtag(fold, itemtag)
})
with doc
Expand All @@ -195,7 +195,7 @@ fn default_par_fold_mod<T:send copy>(
) -> doc::moddoc {
{
item: fold.fold_item(fold, doc.item),
items: par::parmap(doc.items, |itemtag, copy fold| {
items: par::map(doc.items, |itemtag, copy fold| {
fold_itemtag(fold, itemtag)
})
with doc
Expand All @@ -208,7 +208,7 @@ fn default_any_fold_nmod<T:send copy>(
) -> doc::nmoddoc {
{
item: fold.fold_item(fold, doc.item),
fns: par::anymap(doc.fns, |fndoc, copy fold| {
fns: par::map(doc.fns, |fndoc, copy fold| {
fold.fold_fn(fold, fndoc)
})
with doc
Expand All @@ -221,7 +221,7 @@ fn default_seq_fold_nmod<T>(
) -> doc::nmoddoc {
{
item: fold.fold_item(fold, doc.item),
fns: par::seqmap(doc.fns, |fndoc| {
fns: vec::map(doc.fns, |fndoc| {
fold.fold_fn(fold, fndoc)
})
with doc
Expand All @@ -234,7 +234,7 @@ fn default_par_fold_nmod<T:send copy>(
) -> doc::nmoddoc {
{
item: fold.fold_item(fold, doc.item),
fns: par::parmap(doc.fns, |fndoc, copy fold| {
fns: par::map(doc.fns, |fndoc, copy fold| {
fold.fold_fn(fold, fndoc)
})
with doc
Expand Down
4 changes: 2 additions & 2 deletions src/rustdoc/markdown_index_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fn build_mod_index(
config: config::config
) -> doc::index {
{
entries: par::anymap(doc.items, |doc| {
entries: par::map(doc.items, |doc| {
item_to_entry(doc, config)
})
}
Expand All @@ -66,7 +66,7 @@ fn build_nmod_index(
config: config::config
) -> doc::index {
{
entries: par::anymap(doc.fns, |doc| {
entries: par::map(doc.fns, |doc| {
item_to_entry(doc::fntag(doc), config)
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/rustdoc/markdown_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn write_markdown(
doc: doc::doc,
+writer_factory: writer_factory
) {
do par::anymap(doc.pages) |page| {
do par::map(doc.pages) |page| {
let ctxt = {
w: writer_factory(page)
};
Expand Down Expand Up @@ -486,7 +486,7 @@ fn write_sig(ctxt: ctxt, sig: option<str>) {

fn code_block_indent(s: str) -> str {
let lines = str::lines_any(s);
let indented = par::seqmap(lines, |line| #fmt(" %s", line) );
let indented = vec::map(lines, |line| #fmt(" %s", line) );
str::connect(indented, "\n")
}

Expand Down
31 changes: 0 additions & 31 deletions src/rustdoc/par.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/rustdoc/rustdoc.rc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ use rustc(vers = "0.3");
use syntax(vers = "0.3");

import core::*;
import std::par;

mod config;
mod parse;
Expand All @@ -44,7 +45,6 @@ mod sort_pass;
mod sort_item_name_pass;
mod sort_item_type_pass;
mod reexport_pass;
mod par;
mod page_pass;
mod sectionalize_pass;
mod escape_pass;
4 changes: 2 additions & 2 deletions src/rustdoc/sectionalize_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn fold_trait(fold: fold::fold<()>, doc: doc::traitdoc) -> doc::traitdoc {
let doc = fold::default_seq_fold_trait(fold, doc);

{
methods: do par::anymap(doc.methods) |method| {
methods: do par::map(doc.methods) |method| {
let (desc, sections) = sectionalize(method.desc);

{
Expand All @@ -51,7 +51,7 @@ fn fold_impl(fold: fold::fold<()>, doc: doc::impldoc) -> doc::impldoc {
let doc = fold::default_seq_fold_impl(fold, doc);

{
methods: do par::anymap(doc.methods) |method| {
methods: do par::map(doc.methods) |method| {
let (desc, sections) = sectionalize(method.desc);

{
Expand Down
6 changes: 3 additions & 3 deletions src/rustdoc/text_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn fold_item(fold: fold::fold<op>, doc: doc::itemdoc) -> doc::itemdoc {
}

fn apply_to_sections(op: op, sections: ~[doc::section]) -> ~[doc::section] {
par::anymap(sections, |section, copy op| {
par::map(sections, |section, copy op| {
header: op(section.header),
body: op(section.body)
})
Expand All @@ -55,7 +55,7 @@ fn fold_enum(fold: fold::fold<op>, doc: doc::enumdoc) -> doc::enumdoc {
let doc = fold::default_seq_fold_enum(fold, doc);

{
variants: do par::anymap(doc.variants) |variant, copy fold| {
variants: do par::map(doc.variants) |variant, copy fold| {
{
desc: maybe_apply_op(fold.ctxt, variant.desc)
with variant
Expand All @@ -75,7 +75,7 @@ fn fold_trait(fold: fold::fold<op>, doc: doc::traitdoc) -> doc::traitdoc {
}

fn apply_to_methods(op: op, docs: ~[doc::methoddoc]) -> ~[doc::methoddoc] {
do par::anymap(docs) |doc, copy op| {
do par::map(docs) |doc, copy op| {
{
brief: maybe_apply_op(op, doc.brief),
desc: maybe_apply_op(op, doc.desc),
Expand Down
4 changes: 2 additions & 2 deletions src/rustdoc/tystr_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ fn fold_enum(
let srv = fold.ctxt;

{
variants: do par::anymap(doc.variants) |variant| {
variants: do par::map(doc.variants) |variant| {
let sig = do astsrv::exec(srv) |ctxt| {
alt check ctxt.ast_map.get(doc_id) {
ast_map::node_item(@{
Expand Down Expand Up @@ -152,7 +152,7 @@ fn merge_methods(
item_id: doc::ast_id,
docs: ~[doc::methoddoc]
) -> ~[doc::methoddoc] {
do par::anymap(docs) |doc| {
do par::map(docs) |doc| {
{
sig: get_method_sig(srv, item_id, doc.name)
with doc
Expand Down
2 changes: 1 addition & 1 deletion src/rustdoc/unindent_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ fn unindent(s: str) -> str {

if check vec::is_not_empty(lines) {
let unindented = ~[str::trim(vec::head(lines))]
+ do par::anymap(vec::tail(lines)) |line| {
+ do par::map(vec::tail(lines)) |line| {
if str::is_whitespace(line) {
line
} else {
Expand Down