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