@@ -195,7 +195,7 @@ impl<'a> Item<'a> {
195195 fn from_foreign_mod ( fm : & ' a ast:: ForeignMod , span : Span , config : & Config ) -> Item < ' a > {
196196 Item {
197197 keyword : "" ,
198- abi : format_abi ( fm. abi , config. force_explicit_abi ( ) , true ) ,
198+ abi : format_extern ( ast :: Extern :: from_abi ( fm. abi ) , config. force_explicit_abi ( ) , true ) ,
199199 vis : None ,
200200 body : fm
201201 . items
@@ -219,7 +219,8 @@ enum BodyElement<'a> {
219219pub ( crate ) struct FnSig < ' a > {
220220 decl : & ' a ast:: FnDecl ,
221221 generics : & ' a ast:: Generics ,
222- abi : abi:: Abi ,
222+ ext : ast:: Extern ,
223+ // abi: abi::Abi,
223224 is_async : Cow < ' a , ast:: IsAsync > ,
224225 constness : ast:: Constness ,
225226 defaultness : ast:: Defaultness ,
@@ -236,7 +237,7 @@ impl<'a> FnSig<'a> {
236237 FnSig {
237238 decl,
238239 generics,
239- abi : abi :: Abi :: Rust ,
240+ ext : ast :: Extern :: None ,
240241 is_async : Cow :: Owned ( ast:: IsAsync :: NotAsync ) ,
241242 constness : ast:: Constness :: NotConst ,
242243 defaultness : ast:: Defaultness :: Final ,
@@ -246,15 +247,20 @@ impl<'a> FnSig<'a> {
246247 }
247248
248249 pub ( crate ) fn from_method_sig (
249- method_sig : & ' a ast:: MethodSig ,
250+ method_sig : & ' a ast:: FnSig ,
250251 generics : & ' a ast:: Generics ,
251252 ) -> FnSig < ' a > {
253+ // let abi = match method_sig.header.ext {
254+ // ast::Extern::None => abi::Abi::Rust,
255+ // ast::Extern::Implicit => abi::Abi::C,
256+ // ast::Extern::Explicit(abi) => self.lower_abi(abi),
257+ // };
252258 FnSig {
253259 unsafety : method_sig. header . unsafety ,
254260 is_async : Cow :: Borrowed ( & method_sig. header . asyncness . node ) ,
255261 constness : method_sig. header . constness . node ,
256262 defaultness : ast:: Defaultness :: Final ,
257- abi : method_sig. header . abi ,
263+ ext : method_sig. header . ext ,
258264 decl : & * method_sig. decl ,
259265 generics,
260266 visibility : DEFAULT_VISIBILITY ,
@@ -271,7 +277,7 @@ impl<'a> FnSig<'a> {
271277 visit:: FnKind :: ItemFn ( _, fn_header, visibility, _) => FnSig {
272278 decl,
273279 generics,
274- abi : fn_header. abi ,
280+ ext : fn_header. ext ,
275281 constness : fn_header. constness . node ,
276282 is_async : Cow :: Borrowed ( & fn_header. asyncness . node ) ,
277283 defaultness,
@@ -296,8 +302,8 @@ impl<'a> FnSig<'a> {
296302 result. push_str ( format_constness ( self . constness ) ) ;
297303 result. push_str ( format_async ( & self . is_async ) ) ;
298304 result. push_str ( format_unsafety ( self . unsafety ) ) ;
299- result. push_str ( & format_abi (
300- self . abi ,
305+ result. push_str ( & format_extern (
306+ self . ext ,
301307 context. config . force_explicit_abi ( ) ,
302308 false ,
303309 ) ) ;
@@ -383,7 +389,7 @@ impl<'a> FmtVisitor<'a> {
383389 & mut self ,
384390 indent : Indent ,
385391 ident : ast:: Ident ,
386- sig : & ast:: MethodSig ,
392+ sig : & ast:: FnSig ,
387393 generics : & ast:: Generics ,
388394 span : Span ,
389395 ) -> Option < String > {
0 commit comments