@@ -283,7 +283,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
283
283
) ;
284
284
let sig = hir:: FnSig {
285
285
decl,
286
- header : this. lower_fn_header ( header, fn_sig_span , id ) ,
286
+ header : this. lower_fn_header ( header) ,
287
287
span : this. lower_span ( fn_sig_span) ,
288
288
} ;
289
289
hir:: ItemKind :: Fn ( sig, generics, body_id)
@@ -295,17 +295,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
295
295
}
296
296
ModKind :: Unloaded => panic ! ( "`mod` items should have been loaded by now" ) ,
297
297
} ,
298
- ItemKind :: ForeignMod ( ref fm) => {
299
- if fm. abi . is_none ( ) {
300
- self . maybe_lint_missing_abi ( span, id, abi:: Abi :: C { unwind : false } ) ;
301
- }
302
- hir:: ItemKind :: ForeignMod {
303
- abi : fm. abi . map_or ( abi:: Abi :: C { unwind : false } , |abi| self . lower_abi ( abi) ) ,
304
- items : self
305
- . arena
306
- . alloc_from_iter ( fm. items . iter ( ) . map ( |x| self . lower_foreign_item_ref ( x) ) ) ,
307
- }
308
- }
298
+ ItemKind :: ForeignMod ( ref fm) => hir:: ItemKind :: ForeignMod {
299
+ abi : fm. abi . map_or ( abi:: Abi :: FALLBACK , |abi| self . lower_abi ( abi) ) ,
300
+ items : self
301
+ . arena
302
+ . alloc_from_iter ( fm. items . iter ( ) . map ( |x| self . lower_foreign_item_ref ( x) ) ) ,
303
+ } ,
309
304
ItemKind :: GlobalAsm ( ref asm) => {
310
305
hir:: ItemKind :: GlobalAsm ( self . lower_inline_asm ( span, asm) )
311
306
}
@@ -811,7 +806,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
811
806
AssocItemKind :: Fn ( box FnKind ( _, ref sig, ref generics, None ) ) => {
812
807
let names = self . lower_fn_params_to_names ( & sig. decl ) ;
813
808
let ( generics, sig) =
814
- self . lower_method_sig ( generics, sig, trait_item_def_id, false , None , i . id ) ;
809
+ self . lower_method_sig ( generics, sig, trait_item_def_id, false , None ) ;
815
810
( generics, hir:: TraitItemKind :: Fn ( sig, hir:: TraitFn :: Required ( names) ) )
816
811
}
817
812
AssocItemKind :: Fn ( box FnKind ( _, ref sig, ref generics, Some ( ref body) ) ) => {
@@ -824,7 +819,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
824
819
trait_item_def_id,
825
820
false ,
826
821
asyncness. opt_return_id ( ) ,
827
- i. id ,
828
822
) ;
829
823
( generics, hir:: TraitItemKind :: Fn ( sig, hir:: TraitFn :: Provided ( body_id) ) )
830
824
}
@@ -901,7 +895,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
901
895
impl_item_def_id,
902
896
impl_trait_return_allow,
903
897
asyncness. opt_return_id ( ) ,
904
- i. id ,
905
898
) ;
906
899
907
900
( generics, hir:: ImplItemKind :: Fn ( sig, body_id) )
@@ -1296,9 +1289,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
1296
1289
fn_def_id : LocalDefId ,
1297
1290
impl_trait_return_allow : bool ,
1298
1291
is_async : Option < NodeId > ,
1299
- id : NodeId ,
1300
1292
) -> ( hir:: Generics < ' hir > , hir:: FnSig < ' hir > ) {
1301
- let header = self . lower_fn_header ( sig. header , sig . span , id ) ;
1293
+ let header = self . lower_fn_header ( sig. header ) ;
1302
1294
let ( generics, decl) = self . add_in_band_defs (
1303
1295
generics,
1304
1296
fn_def_id,
@@ -1315,12 +1307,12 @@ impl<'hir> LoweringContext<'_, 'hir> {
1315
1307
( generics, hir:: FnSig { header, decl, span : self . lower_span ( sig. span ) } )
1316
1308
}
1317
1309
1318
- fn lower_fn_header ( & mut self , h : FnHeader , span : Span , id : NodeId ) -> hir:: FnHeader {
1310
+ fn lower_fn_header ( & mut self , h : FnHeader ) -> hir:: FnHeader {
1319
1311
hir:: FnHeader {
1320
1312
unsafety : self . lower_unsafety ( h. unsafety ) ,
1321
1313
asyncness : self . lower_asyncness ( h. asyncness ) ,
1322
1314
constness : self . lower_constness ( h. constness ) ,
1323
- abi : self . lower_extern ( h. ext , span , id ) ,
1315
+ abi : self . lower_extern ( h. ext ) ,
1324
1316
}
1325
1317
}
1326
1318
@@ -1331,13 +1323,10 @@ impl<'hir> LoweringContext<'_, 'hir> {
1331
1323
} )
1332
1324
}
1333
1325
1334
- pub ( super ) fn lower_extern ( & mut self , ext : Extern , span : Span , id : NodeId ) -> abi:: Abi {
1326
+ pub ( super ) fn lower_extern ( & mut self , ext : Extern ) -> abi:: Abi {
1335
1327
match ext {
1336
1328
Extern :: None => abi:: Abi :: Rust ,
1337
- Extern :: Implicit => {
1338
- self . maybe_lint_missing_abi ( span, id, abi:: Abi :: C { unwind : false } ) ;
1339
- abi:: Abi :: C { unwind : false }
1340
- }
1329
+ Extern :: Implicit => abi:: Abi :: FALLBACK ,
1341
1330
Extern :: Explicit ( abi) => self . lower_abi ( abi) ,
1342
1331
}
1343
1332
}
0 commit comments