diff --git a/nac3core/src/codegen/expr.rs b/nac3core/src/codegen/expr.rs index 6c8af87db..9f1d1fa0f 100644 --- a/nac3core/src/codegen/expr.rs +++ b/nac3core/src/codegen/expr.rs @@ -448,7 +448,8 @@ pub fn gen_call<'ctx, 'a, G: CodeGenerator>( if let Some(obj) = &obj { args.insert(0, FuncArg { name: "self".into(), ty: obj.0, default_value: None }); } - let params = args.iter().map(|arg| ctx.get_llvm_type(generator, arg.ty).into()).collect_vec(); + let params = + args.iter().map(|arg| ctx.get_llvm_type(generator, arg.ty).into()).collect_vec(); let fun_ty = if ctx.unifier.unioned(fun.0.ret, ctx.primitives.none) { ctx.ctx.void_type().fn_type(¶ms, false) } else { diff --git a/nac3core/src/codegen/irrt/mod.rs b/nac3core/src/codegen/irrt/mod.rs index af48bd203..6ba63b73c 100644 --- a/nac3core/src/codegen/irrt/mod.rs +++ b/nac3core/src/codegen/irrt/mod.rs @@ -1,13 +1,10 @@ use super::CodeGenContext; use inkwell::{ - context::Context, - attributes::AttributeLoc, - memory_buffer::MemoryBuffer, - module::Module, + attributes::AttributeLoc, context::Context, memory_buffer::MemoryBuffer, module::Module, values::IntValue, }; -pub fn load_irrt<'ctx>(ctx: &'ctx Context) -> Module<'ctx> { +pub fn load_irrt(ctx: &Context) -> Module { let bitcode_buf = MemoryBuffer::create_from_memory_range( include_bytes!(concat!(env!("OUT_DIR"), "/irrt.bc")), "irrt_bitcode_buffer", @@ -19,7 +16,7 @@ pub fn load_irrt<'ctx>(ctx: &'ctx Context) -> Module<'ctx> { let function = irrt_mod.get_function(symbol).unwrap(); function.add_attribute(AttributeLoc::Function, ctx.create_enum_attribute(1, 0)); } - return irrt_mod; + irrt_mod } // repeated squaring method adapted from GNU Scientific Library: diff --git a/nac3core/src/codegen/stmt.rs b/nac3core/src/codegen/stmt.rs index 333ed351c..9903bd881 100644 --- a/nac3core/src/codegen/stmt.rs +++ b/nac3core/src/codegen/stmt.rs @@ -1,10 +1,7 @@ use super::{ super::symbol_resolver::ValueEnum, expr::destructure_range, CodeGenContext, CodeGenerator, }; -use crate::{ - codegen::expr::gen_binop_expr, - typecheck::typedef::Type, -}; +use crate::{codegen::expr::gen_binop_expr, typecheck::typedef::Type}; use inkwell::{ types::BasicTypeEnum, values::{BasicValue, BasicValueEnum, PointerValue}, diff --git a/nac3core/src/typecheck/type_inferencer/mod.rs b/nac3core/src/typecheck/type_inferencer/mod.rs index ad32baaa1..a6ca491bf 100644 --- a/nac3core/src/typecheck/type_inferencer/mod.rs +++ b/nac3core/src/typecheck/type_inferencer/mod.rs @@ -688,7 +688,7 @@ impl<'a> Inferencer<'a> { location: args[0].location, custom, node: ExprKind::Constant { - value: ast::Constant::Int(val.clone()), + value: ast::Constant::Int(*val), kind: kind.clone(), }, }); diff --git a/runkernel/src/main.rs b/runkernel/src/main.rs index 5ce64d9ce..68f7cb548 100644 --- a/runkernel/src/main.rs +++ b/runkernel/src/main.rs @@ -1,5 +1,4 @@ use std::env; -use libloading; static mut NOW: i64 = 0;