@@ -46,9 +46,9 @@ use rustc_ast as ast;
4646use rustc_ast:: * ;
4747use rustc_data_structures:: fx:: FxHashSet ;
4848use rustc_errors:: ErrorGuaranteed ;
49- use rustc_hir as hir;
5049use rustc_hir:: attrs:: { AttributeKind , InlineAttr } ;
5150use rustc_hir:: def_id:: DefId ;
51+ use rustc_hir:: { self as hir, FnDeclFlags } ;
5252use rustc_middle:: span_bug;
5353use rustc_middle:: ty:: Asyncness ;
5454use rustc_span:: symbol:: kw;
@@ -271,7 +271,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
271271 // Function parameter count, including C variadic `...` if present.
272272 fn param_count ( & self , def_id : DefId ) -> ( usize , bool /*c_variadic*/ ) {
273273 let sig = self . tcx . fn_sig ( def_id) . skip_binder ( ) . skip_binder ( ) ;
274- ( sig. inputs ( ) . len ( ) + usize:: from ( sig. c_variadic ) , sig. c_variadic )
274+ ( sig. inputs ( ) . len ( ) + usize:: from ( sig. c_variadic ( ) ) , sig. c_variadic ( ) )
275275 }
276276
277277 fn lower_delegation_decl (
@@ -309,9 +309,9 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
309309 self . arena . alloc ( hir:: FnDecl {
310310 inputs,
311311 output : hir:: FnRetTy :: Return ( output) ,
312- c_variadic ,
313- lifetime_elision_allowed : true ,
314- implicit_self : hir :: ImplicitSelfKind :: None ,
312+ fn_decl_kind : FnDeclFlags :: default ( )
313+ . set_lifetime_elision_allowed ( true )
314+ . set_c_variadic ( c_variadic ) ,
315315 } )
316316 }
317317
@@ -331,11 +331,11 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
331331 safety : if self . tcx . codegen_fn_attrs ( sig_id) . safe_target_features {
332332 hir:: HeaderSafety :: SafeTargetFeatures
333333 } else {
334- hir:: HeaderSafety :: Normal ( sig. safety )
334+ hir:: HeaderSafety :: Normal ( sig. safety ( ) )
335335 } ,
336336 constness : self . tcx . constness ( sig_id) ,
337337 asyncness,
338- abi : sig. abi ,
338+ abi : sig. abi ( ) ,
339339 } ;
340340
341341 hir:: FnSig { decl, header, span }
@@ -603,13 +603,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
603603 span : Span ,
604604 delegation : & Delegation ,
605605 ) -> DelegationResults < ' hir > {
606- let decl = self . arena . alloc ( hir:: FnDecl {
607- inputs : & [ ] ,
608- output : hir:: FnRetTy :: DefaultReturn ( span) ,
609- c_variadic : false ,
610- lifetime_elision_allowed : true ,
611- implicit_self : hir:: ImplicitSelfKind :: None ,
612- } ) ;
606+ let decl = self . arena . alloc ( hir:: FnDecl :: dummy ( span) ) ;
613607
614608 let header = self . generate_header_error ( ) ;
615609 let sig = hir:: FnSig { decl, header, span } ;
0 commit comments