@@ -50,6 +50,7 @@ use externalfiles::ExternalHtml;
5050
5151use serialize:: json;
5252use serialize:: json:: ToJson ;
53+ use syntax:: abi;
5354use syntax:: ast;
5455use syntax:: ast_util;
5556use rustc:: util:: nodemap:: NodeSet ;
@@ -1809,15 +1810,22 @@ fn assoc_type(w: &mut fmt::Formatter, it: &clean::Item,
18091810}
18101811
18111812fn render_method ( w : & mut fmt:: Formatter , meth : & clean:: Item ) -> fmt:: Result {
1812- fn method ( w : & mut fmt:: Formatter , it : & clean:: Item , unsafety : ast:: Unsafety ,
1813- g : & clean:: Generics , selfty : & clean:: SelfTy ,
1814- d : & clean:: FnDecl ) -> fmt:: Result {
1815- write ! ( w, "{}fn <a href='#{ty}.{name}' class='fnname'>{name}</a>\
1813+ fn method ( w : & mut fmt:: Formatter , it : & clean:: Item ,
1814+ unsafety : ast:: Unsafety , abi : abi:: Abi ,
1815+ g : & clean:: Generics , selfty : & clean:: SelfTy ,
1816+ d : & clean:: FnDecl ) -> fmt:: Result {
1817+ use syntax:: abi:: Abi ;
1818+
1819+ write ! ( w, "{}{}fn <a href='#{ty}.{name}' class='fnname'>{name}</a>\
18161820 {generics}{decl}{where_clause}",
18171821 match unsafety {
18181822 ast:: Unsafety :: Unsafe => "unsafe " ,
18191823 _ => "" ,
18201824 } ,
1825+ match abi {
1826+ Abi :: Rust => String :: new( ) ,
1827+ a => format!( "extern {} " , a. to_string( ) )
1828+ } ,
18211829 ty = shortty( it) ,
18221830 name = it. name. as_ref( ) . unwrap( ) ,
18231831 generics = * g,
@@ -1826,10 +1834,10 @@ fn render_method(w: &mut fmt::Formatter, meth: &clean::Item) -> fmt::Result {
18261834 }
18271835 match meth. inner {
18281836 clean:: TyMethodItem ( ref m) => {
1829- method ( w, meth, m. unsafety , & m. generics , & m. self_ , & m. decl )
1837+ method ( w, meth, m. unsafety , m . abi , & m. generics , & m. self_ , & m. decl )
18301838 }
18311839 clean:: MethodItem ( ref m) => {
1832- method ( w, meth, m. unsafety , & m. generics , & m. self_ , & m. decl )
1840+ method ( w, meth, m. unsafety , m . abi , & m. generics , & m. self_ , & m. decl )
18331841 }
18341842 clean:: AssociatedTypeItem ( ref typ) => {
18351843 assoc_type ( w, meth, typ)
0 commit comments