From 261613276693ee9e8085e6b1da9394300fdfcfde Mon Sep 17 00:00:00 2001 From: Edgar Luque Date: Fri, 9 Feb 2024 09:19:50 +0100 Subject: [PATCH] clippy --- lib/edlang_codegen_llvm/src/codegen.rs | 12 ++++++------ lib/edlang_lowering/src/common.rs | 4 ++-- lib/edlang_lowering/src/lib.rs | 6 +++--- lib/edlang_parser/src/lib.rs | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/edlang_codegen_llvm/src/codegen.rs b/lib/edlang_codegen_llvm/src/codegen.rs index 1d799d173d..bf259925d3 100644 --- a/lib/edlang_codegen_llvm/src/codegen.rs +++ b/lib/edlang_codegen_llvm/src/codegen.rs @@ -33,13 +33,13 @@ struct ModuleCompileCtx<'ctx, 'm> { di_builder: DebugInfoBuilder<'ctx>, di_unit: DICompileUnit<'ctx>, target_data: TargetData, - module_id: DefId, + _module_id: DefId, di_namespace: DIScope<'ctx>, } impl<'ctx, 'm> ModuleCompileCtx<'ctx, 'm> { - pub fn get_module_body(&self) -> &ModuleBody { - self.ctx.program.modules.get(&self.module_id).unwrap() + pub fn _get_module_body(&self) -> &ModuleBody { + self.ctx.program.modules.get(&self._module_id).unwrap() } pub fn set_debug_loc(&self, scope: DIScope<'ctx>, span: Span) -> DILocation<'ctx> { @@ -122,7 +122,7 @@ pub fn compile(session: &Session, program: &ProgramBody) -> Result Result<(), BuilderError> let di_program = fn_value.get_subprogram().unwrap(); let mut debug_loc = ctx.set_debug_loc(di_program.as_debug_info_scope(), body.fn_span); - let mut lexical_block = ctx.di_builder.create_lexical_block( + let lexical_block = ctx.di_builder.create_lexical_block( debug_loc.get_scope(), ctx.di_unit.get_file(), debug_loc.get_line(), @@ -911,7 +911,7 @@ fn compile_value<'ctx>( }) } -fn compile_type<'a>( +fn _compile_type<'a>( ctx: &'a ModuleCompileCtx, ty: &ir::TypeInfo, ) -> inkwell::types::AnyTypeEnum<'a> { diff --git a/lib/edlang_lowering/src/common.rs b/lib/edlang_lowering/src/common.rs index 11d1df801b..51f536fc52 100644 --- a/lib/edlang_lowering/src/common.rs +++ b/lib/edlang_lowering/src/common.rs @@ -70,7 +70,7 @@ impl BodyBuilder { id } - pub fn add_temp_local(&mut self, ty_kind: TypeKind) -> usize { + pub fn _add_temp_local(&mut self, ty_kind: TypeKind) -> usize { let id = self.body.locals.len(); self.body.locals.push(Local::temp(TypeInfo { span: None, @@ -79,7 +79,7 @@ impl BodyBuilder { id } - pub fn get_local(&self, name: &str) -> Option<&Local> { + pub fn _get_local(&self, name: &str) -> Option<&Local> { self.body.locals.get(*(self.name_to_local.get(name)?)) } diff --git a/lib/edlang_lowering/src/lib.rs b/lib/edlang_lowering/src/lib.rs index 0f9c27aa95..c3daff8cc0 100644 --- a/lib/edlang_lowering/src/lib.rs +++ b/lib/edlang_lowering/src/lib.rs @@ -1,12 +1,12 @@ use std::collections::HashMap; use ast::ModuleStatement; -use common::{BodyBuilder, BuildCtx, IdGenerator}; +use common::{BodyBuilder, BuildCtx}; use edlang_ast as ast; use edlang_ir as ir; use ir::{ - BasicBlock, Body, ConstData, ConstKind, DefId, Local, LocalKind, Operand, Place, ProgramBody, - RValue, Statement, StatementKind, Terminator, TypeInfo, TypeKind, + BasicBlock, Body, DefId, Local, LocalKind, Operand, Place, ProgramBody, Statement, + StatementKind, Terminator, TypeInfo, TypeKind, }; mod common; diff --git a/lib/edlang_parser/src/lib.rs b/lib/edlang_parser/src/lib.rs index c357865f29..39e78eb141 100644 --- a/lib/edlang_parser/src/lib.rs +++ b/lib/edlang_parser/src/lib.rs @@ -125,6 +125,6 @@ mod test { #[test] fn test_ident() { - parse_ast("hello"); + parse_ast("hello").unwrap(); } }