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
4 changed files with 43 additions and 15 deletions

View File

@@ -468,11 +468,7 @@ impl fmt::Display for clean::Type {
clean::BareFunction(ref decl) => {
write!(f, "{}{}fn{}{}",
UnsafetySpace(decl.unsafety),
match &*decl.abi {
"" => " extern ".to_string(),
"\"Rust\"" => "".to_string(),
s => format!(" extern {} ", s)
},
AbiSpace(decl.abi),
decl.generics,
decl.decl)
}
@@ -788,7 +784,7 @@ impl fmt::Display for AbiSpace {
match self.0 {
Abi::Rust => Ok(()),
Abi::C => write!(f, "extern "),
abi => write!(f, "extern {} ", abi),
abi => write!(f, "extern &quot;{}&quot; ", abi.name()),
}
}
}