@@ -98,7 +98,6 @@ pub struct FnParamTokens {
98
98
/// Generic argument list `<'a0, 'a1, ...>` after `type CallSig`, if available.
99
99
pub callsig_lifetime_args : Option < TokenStream > ,
100
100
pub arg_exprs : Vec < TokenStream > ,
101
- pub func_general_lifetime : Option < TokenStream > ,
102
101
}
103
102
104
103
pub fn make_function_definition (
@@ -142,7 +141,6 @@ pub fn make_function_definition(
142
141
callsig_param_types : param_types,
143
142
callsig_lifetime_args,
144
143
arg_exprs : arg_names,
145
- func_general_lifetime : fn_lifetime,
146
144
} = if sig. is_virtual ( ) {
147
145
make_params_exprs_virtual ( sig. params ( ) . iter ( ) , sig)
148
146
} else {
@@ -175,11 +173,14 @@ pub fn make_function_definition(
175
173
default_structs_code = TokenStream :: new ( ) ;
176
174
} ;
177
175
176
+ let func_generic_params = sig. return_value ( ) . generic_params ( ) ;
177
+ let func_generic_bounds = sig. return_value ( ) . generic_bounds ( ) ;
178
+
178
179
let call_sig_decl = {
179
180
let return_ty = & sig. return_value ( ) . type_tokens ( ) ;
180
181
181
182
quote ! {
182
- type CallRet = #return_ty;
183
+ type CallRet #func_generic_params = #return_ty;
183
184
type CallParams #callsig_lifetime_args = ( #( #param_types, ) * ) ;
184
185
}
185
186
} ;
@@ -279,10 +280,12 @@ pub fn make_function_definition(
279
280
280
281
quote ! {
281
282
#maybe_safety_doc
282
- #vis #maybe_unsafe fn #primary_fn_name #fn_lifetime (
283
+ #vis #maybe_unsafe fn #primary_fn_name #func_generic_params (
283
284
#receiver_param
284
285
#( #params, ) *
285
- ) #return_decl {
286
+ ) #return_decl
287
+ #func_generic_bounds
288
+ {
286
289
#call_sig_decl
287
290
288
291
let args = ( #( #arg_names, ) * ) ;
@@ -357,9 +360,9 @@ pub(crate) enum FnKind {
357
360
/// `call()` forwarding to `try_call()`.
358
361
DelegateTry ,
359
362
360
- /// Default extender `new()` associated function -- optional receiver and required parameters .
361
- ExBuilderConstructor ,
362
-
363
+ // Currently not used – uncomment when needed again .
364
+ // /// Default extender `new()` associated function -- optional receiver and required parameters.
365
+ // ExBuilderConstructor,
363
366
/// Same as [`ExBuilderConstructor`], but for a builder with an explicit lifetime.
364
367
ExBuilderConstructorLifetimed ,
365
368
@@ -489,6 +492,7 @@ pub(crate) fn make_param_or_field_type(
489
492
..
490
493
}
491
494
| RustTy :: BuiltinArray { .. }
495
+ | RustTy :: GenericArray
492
496
| RustTy :: EngineArray { .. } => {
493
497
let lft = lifetimes. next ( ) ;
494
498
special_ty = Some ( quote ! { RefArg <#lft, #ty> } ) ;
@@ -572,7 +576,7 @@ pub(crate) fn make_params_exprs<'a>(
572
576
// Methods relevant in the context of default parameters. Flow in this order.
573
577
// Note that for builder methods of Ex* structs, there's a direct call in default_parameters.rs to the parameter manipulation methods,
574
578
// bypassing this method. So one case is missing here.
575
- FnKind :: ExBuilderConstructor => ( FnParamDecl :: FnPublic , FnArgExpr :: StoreInField ) ,
579
+ // FnKind::ExBuilderConstructor => (FnParamDecl::FnPublic, FnArgExpr::StoreInField),
576
580
FnKind :: ExBuilderConstructorLifetimed => {
577
581
( FnParamDecl :: FnPublicLifetime , FnArgExpr :: StoreInField )
578
582
}
0 commit comments