1
Fork 0

Auto merge of #33151 - ollie27:rustdoc_abi, r=alexcrichton

rustdoc: Cleanup ABI rendering

Use a common method for rendering `extern "<abi>"`.

This now consistently shows `extern fn` rather than `extern "C" fn`.
This commit is contained in:
bors 2016-04-27 23:16:41 -07:00
commit cf3970aac5
4 changed files with 43 additions and 15 deletions

View file

@ -2158,8 +2158,6 @@ fn render_assoc_item(w: &mut fmt::Formatter,
d: &clean::FnDecl,
link: AssocItemLink)
-> fmt::Result {
use syntax::abi::Abi;
let name = meth.name.as_ref().unwrap();
let anchor = format!("#{}.{}", shortty(meth), name);
let href = match link {
@ -2186,10 +2184,7 @@ fn render_assoc_item(w: &mut fmt::Formatter,
{generics}{decl}{where_clause}",
ConstnessSpace(vis_constness),
UnsafetySpace(unsafety),
match abi {
Abi::Rust => String::new(),
a => format!("extern {} ", a.to_string())
},
AbiSpace(abi),
href = href,
name = name,
generics = *g,