@@ -195,7 +195,7 @@ impl<'a> Item<'a> {
195
195
fn from_foreign_mod ( fm : & ' a ast:: ForeignMod , span : Span , config : & Config ) -> Item < ' a > {
196
196
Item {
197
197
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 ) ,
199
199
vis : None ,
200
200
body : fm
201
201
. items
@@ -219,7 +219,8 @@ enum BodyElement<'a> {
219
219
pub ( crate ) struct FnSig < ' a > {
220
220
decl : & ' a ast:: FnDecl ,
221
221
generics : & ' a ast:: Generics ,
222
- abi : abi:: Abi ,
222
+ ext : ast:: Extern ,
223
+ // abi: abi::Abi,
223
224
is_async : Cow < ' a , ast:: IsAsync > ,
224
225
constness : ast:: Constness ,
225
226
defaultness : ast:: Defaultness ,
@@ -236,7 +237,7 @@ impl<'a> FnSig<'a> {
236
237
FnSig {
237
238
decl,
238
239
generics,
239
- abi : abi :: Abi :: Rust ,
240
+ ext : ast :: Extern :: None ,
240
241
is_async : Cow :: Owned ( ast:: IsAsync :: NotAsync ) ,
241
242
constness : ast:: Constness :: NotConst ,
242
243
defaultness : ast:: Defaultness :: Final ,
@@ -246,15 +247,20 @@ impl<'a> FnSig<'a> {
246
247
}
247
248
248
249
pub ( crate ) fn from_method_sig (
249
- method_sig : & ' a ast:: MethodSig ,
250
+ method_sig : & ' a ast:: FnSig ,
250
251
generics : & ' a ast:: Generics ,
251
252
) -> 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
+ // };
252
258
FnSig {
253
259
unsafety : method_sig. header . unsafety ,
254
260
is_async : Cow :: Borrowed ( & method_sig. header . asyncness . node ) ,
255
261
constness : method_sig. header . constness . node ,
256
262
defaultness : ast:: Defaultness :: Final ,
257
- abi : method_sig. header . abi ,
263
+ ext : method_sig. header . ext ,
258
264
decl : & * method_sig. decl ,
259
265
generics,
260
266
visibility : DEFAULT_VISIBILITY ,
@@ -271,7 +277,7 @@ impl<'a> FnSig<'a> {
271
277
visit:: FnKind :: ItemFn ( _, fn_header, visibility, _) => FnSig {
272
278
decl,
273
279
generics,
274
- abi : fn_header. abi ,
280
+ ext : fn_header. ext ,
275
281
constness : fn_header. constness . node ,
276
282
is_async : Cow :: Borrowed ( & fn_header. asyncness . node ) ,
277
283
defaultness,
@@ -296,8 +302,8 @@ impl<'a> FnSig<'a> {
296
302
result. push_str ( format_constness ( self . constness ) ) ;
297
303
result. push_str ( format_async ( & self . is_async ) ) ;
298
304
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 ,
301
307
context. config . force_explicit_abi ( ) ,
302
308
false ,
303
309
) ) ;
@@ -383,7 +389,7 @@ impl<'a> FmtVisitor<'a> {
383
389
& mut self ,
384
390
indent : Indent ,
385
391
ident : ast:: Ident ,
386
- sig : & ast:: MethodSig ,
392
+ sig : & ast:: FnSig ,
387
393
generics : & ast:: Generics ,
388
394
span : Span ,
389
395
) -> Option < String > {
0 commit comments