Skip to content

Commit

Permalink
rustdoc: Document explicit self in methods. Closes rust-lang#5254
Browse files Browse the repository at this point in the history
  • Loading branch information
z0w0 committed Mar 14, 2013
1 parent 58f248d commit 4f23850
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/librustdoc/tystr_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn get_fn_sig(srv: astsrv::Srv, fn_id: doc::AstId) -> Option<~str> {
ident: ident,
node: ast::foreign_item_fn(ref decl, _, ref tys), _
}, _, _) => {
Some(pprust::fun_to_str(decl, ident, tys,
Some(pprust::fun_to_str(decl, ident, None, tys,
extract::interner()))
}
_ => fail!(~"get_fn_sig: fn_id not bound to a fn item")
Expand Down Expand Up @@ -215,6 +215,7 @@ fn get_method_sig(
Some(pprust::fun_to_str(
&ty_m.decl,
ty_m.ident,
Some(ty_m.self_ty.node),
&ty_m.generics,
extract::interner()
))
Expand All @@ -223,6 +224,7 @@ fn get_method_sig(
Some(pprust::fun_to_str(
&m.decl,
m.ident,
Some(m.self_ty.node),
&m.generics,
extract::interner()
))
Expand All @@ -242,6 +244,7 @@ fn get_method_sig(
Some(pprust::fun_to_str(
&method.decl,
method.ident,
Some(method.self_ty.node),
&method.generics,
extract::interner()
))
Expand Down
3 changes: 2 additions & 1 deletion src/libsyntax/print/pprust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,11 @@ pub fn path_to_str(&&p: @ast::path, intr: @ident_interner) -> ~str {
}

pub fn fun_to_str(decl: &ast::fn_decl, name: ast::ident,
opt_self_ty: Option<ast::self_ty_>,
generics: &ast::Generics, intr: @ident_interner) -> ~str {
do io::with_str_writer |wr| {
let s = rust_printer(wr, intr);
print_fn(s, decl, None, name, generics, None, ast::inherited);
print_fn(s, decl, None, name, generics, opt_self_ty, ast::inherited);
end(s); // Close the head box
end(s); // Close the outer box
eof(s.s);
Expand Down

0 comments on commit 4f23850

Please sign in to comment.