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:
@@ -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 "{}" ", abi.name()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user