Fix rustdoc and rusti

This commit is contained in:
James Miller 2013-07-06 18:47:20 +12:00
parent 7ce68dc9e1
commit fb19205b1b
3 changed files with 8 additions and 9 deletions

View file

@ -94,7 +94,7 @@ fn fold_const(
do astsrv::exec(srv) |ctxt| {
match ctxt.ast_map.get_copy(&doc.id()) {
ast_map::node_item(@ast::item {
node: ast::item_static(ty, _, _), _
node: ast::item_static(ref ty, _, _), _
}, _) => {
pprust::ty_to_str(ty, extract::interner())
}
@ -245,12 +245,12 @@ fn fold_impl(
do astsrv::exec(srv) |ctxt| {
match ctxt.ast_map.get_copy(&doc.id()) {
ast_map::node_item(@ast::item {
node: ast::item_impl(ref generics, opt_trait_type, self_ty, _), _
node: ast::item_impl(ref generics, ref opt_trait_type, ref self_ty, _), _
}, _) => {
let bounds = pprust::generics_to_str(generics, extract::interner());
let bounds = if bounds.is_empty() { None } else { Some(bounds) };
let trait_types = opt_trait_type.map_default(~[], |p| {
~[pprust::path_to_str(p.path, extract::interner())]
~[pprust::path_to_str(&p.path, extract::interner())]
});
(bounds,
trait_types,
@ -285,15 +285,14 @@ fn fold_type(
match ctxt.ast_map.get_copy(&doc.id()) {
ast_map::node_item(@ast::item {
ident: ident,
node: ast::item_ty(ty, ref params), _
node: ast::item_ty(ref ty, ref params), _
}, _) => {
Some(fmt!(
"type %s%s = %s",
to_str(ident),
pprust::generics_to_str(params,
extract::interner()),
pprust::ty_to_str(ty,
extract::interner())
pprust::ty_to_str(ty, extract::interner())
))
}
_ => fail!("expected type")

View file

@ -132,7 +132,7 @@ fn run(mut repl: Repl, input: ~str) -> Repl {
// differently beause they must appear before all 'use' statements
for blk.node.view_items.iter().advance |vi| {
let s = do with_pp(intr) |pp, _| {
pprust::print_view_item(pp, *vi);
pprust::print_view_item(pp, vi);
};
match vi.node {
ast::view_item_extern_mod(*) => {

View file

@ -14,14 +14,14 @@ use syntax::print::pp;
use syntax::print::pprust;
use syntax::parse::token;
pub fn each_binding(l: @ast::local, f: @fn(@ast::Path, ast::node_id)) {
pub fn each_binding(l: @ast::local, f: @fn(&ast::Path, ast::node_id)) {
use syntax::visit;
let vt = visit::mk_simple_visitor(
@visit::SimpleVisitor {
visit_pat: |pat| {
match pat.node {
ast::pat_ident(_, path, _) => {
ast::pat_ident(_, ref path, _) => {
f(path, pat.id);
}
_ => {}