From ec1ee223a0cf75a5f7ce7c1ffc0799e50d6fb6c2 Mon Sep 17 00:00:00 2001 From: lyken Date: Wed, 28 Aug 2024 12:56:43 +0800 Subject: [PATCH] attempt to reduce lifetimes in FnCall --- nac3core/src/codegen/model/function.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nac3core/src/codegen/model/function.rs b/nac3core/src/codegen/model/function.rs index 62e9f25f..715002a0 100644 --- a/nac3core/src/codegen/model/function.rs +++ b/nac3core/src/codegen/model/function.rs @@ -35,19 +35,19 @@ struct Arg<'ctx> { /// If `my_function_name` has not been declared in `ctx.module`, once `.returning()` is called, a function /// declaration of `my_function_name` is added to `ctx.module`, where the [`FunctionType`] is deduced from /// the argument types and returning type. -pub struct FnCall<'ctx, 'a, 'b, 'c, 'd, G: CodeGenerator + ?Sized> { - generator: &'d mut G, +pub struct FnCall<'ctx, 'a, 'b, G: CodeGenerator + ?Sized> { + generator: &'b mut G, ctx: &'b CodeGenContext<'ctx, 'a>, /// Function name - name: &'c str, + name: &'b str, /// Call arguments args: Vec>, /// LLVM function Attributes attrs: Vec<&'static str>, } -impl<'ctx, 'a, 'b, 'c, 'd, G: CodeGenerator + ?Sized> FnCall<'ctx, 'a, 'b, 'c, 'd, G> { - pub fn begin(generator: &'d mut G, ctx: &'b CodeGenContext<'ctx, 'a>, name: &'c str) -> Self { +impl<'ctx, 'a, 'b, G: CodeGenerator + ?Sized> FnCall<'ctx, 'a, 'b, G> { + pub fn begin(generator: &'b mut G, ctx: &'b CodeGenContext<'ctx, 'a>, name: &'b str) -> Self { FnCall { generator, ctx, name, args: Vec::new(), attrs: Vec::new() } }