Skip to content

Commit aaffcb5

Browse files
committed
Remove func_general_lifetime from FnParamTokens since it was never set. Remove ExBuilderConstructor – it was doing nothing, and in practice it was supposed to do the same thing as ExBuilderConstructorLifetimed.
1 parent 46003b5 commit aaffcb5

File tree

2 files changed

+2
-16
lines changed

2 files changed

+2
-16
lines changed

godot-codegen/src/generator/default_parameters.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@ pub fn make_function_definition_with_defaults(
5959
&default_fn_params,
6060
);
6161

62-
// ExBuilder::new() constructor signature.
63-
let FnParamTokens {
64-
func_general_lifetime: simple_fn_lifetime,
65-
..
66-
} = fns::make_params_exprs(
67-
required_fn_params.iter().cloned(),
68-
FnKind::ExBuilderConstructor,
69-
);
70-
7162
let return_decl = &sig.return_value().decl;
7263

7364
// If either the builder has a lifetime (non-static/global method), or one of its parameters is a reference,
@@ -119,7 +110,7 @@ pub fn make_function_definition_with_defaults(
119110
// Lifetime is set if any parameter is a reference.
120111
#[doc = #default_parameter_usage]
121112
#[inline]
122-
#vis fn #simple_fn_name #simple_fn_lifetime (
113+
#vis fn #simple_fn_name (
123114
#simple_receiver_param
124115
#( #class_method_required_params, )*
125116
) #return_decl {

godot-codegen/src/generator/functions_common.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ pub struct FnParamTokens {
9898
/// Generic argument list `<'a0, 'a1, ...>` after `type CallSig`, if available.
9999
pub callsig_lifetime_args: Option<TokenStream>,
100100
pub arg_exprs: Vec<TokenStream>,
101-
pub func_general_lifetime: Option<TokenStream>,
102101
}
103102

104103
pub fn make_function_definition(
@@ -361,10 +360,7 @@ pub(crate) enum FnKind {
361360
/// `call()` forwarding to `try_call()`.
362361
DelegateTry,
363362

364-
/// Default extender `new()` associated function -- optional receiver and required parameters.
365-
ExBuilderConstructor,
366-
367-
/// Same as [`ExBuilderConstructor`], but for a builder with an explicit lifetime.
363+
/// Default extender `new()` associated function -- optional receiver and required parameters. Has an explicit lifetime.
368364
ExBuilderConstructorLifetimed,
369365

370366
/// Default extender `new()` associated function -- only default parameters.
@@ -577,7 +573,6 @@ pub(crate) fn make_params_exprs<'a>(
577573
// Methods relevant in the context of default parameters. Flow in this order.
578574
// Note that for builder methods of Ex* structs, there's a direct call in default_parameters.rs to the parameter manipulation methods,
579575
// bypassing this method. So one case is missing here.
580-
FnKind::ExBuilderConstructor => (FnParamDecl::FnPublic, FnArgExpr::StoreInField),
581576
FnKind::ExBuilderConstructorLifetimed => {
582577
(FnParamDecl::FnPublicLifetime, FnArgExpr::StoreInField)
583578
}

0 commit comments

Comments
 (0)