Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix rustdoc and rusti
  • Loading branch information
James Miller committed Jul 7, 2013
1 parent 7ce68dc commit fb19205
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
11 changes: 5 additions & 6 deletions src/librustdoc/tystr_pass.rs
Expand Up @@ -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())
}
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion src/librusti/rusti.rs
Expand Up @@ -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(*) => {
Expand Down
4 changes: 2 additions & 2 deletions src/librusti/utils.rs
Expand Up @@ -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);
}
_ => {}
Expand Down

0 comments on commit fb19205

Please sign in to comment.