diff --git a/compiler/src/passes/conclude/conclude.rs b/compiler/src/passes/conclude/conclude.rs index 4b669f2..525af52 100644 --- a/compiler/src/passes/conclude/conclude.rs +++ b/compiler/src/passes/conclude/conclude.rs @@ -27,7 +27,7 @@ impl<'p> X86Patched<'p> { for instr in &mut block.instrs { match instr { Instr::CallDirect { lbl, .. } | Instr::LoadLbl { lbl, .. } => { - *lbl = entries[&lbl]; + *lbl = entries[lbl]; } _ => {} } @@ -70,14 +70,6 @@ fn fix_stack_space(block: &mut Block, stack_space: usize) { assert_eq!(*val, 0x1000); *val = stack_space as i32; } - InstrAssigned::Add { - src: Arg::Imm(_), .. - } - | InstrAssigned::Sub { - src: Arg::Imm(_), .. - } => { - todo!() - } _ => {} } } diff --git a/compiler/src/passes/eliminate/eliminate_params.rs b/compiler/src/passes/eliminate/eliminate_params.rs index c33e121..b4605ae 100644 --- a/compiler/src/passes/eliminate/eliminate_params.rs +++ b/compiler/src/passes/eliminate/eliminate_params.rs @@ -35,7 +35,7 @@ pub fn flatten_type<'p>( Type::Int { .. } | Type::Bool | Type::Unit | Type::Never | Type::Fn { .. } => { vec![(sym, typ.clone())] } - Type::Var { sym: def_sym } => match &defs[&def_sym] { + Type::Var { sym: def_sym } => match &defs[def_sym] { TypeDef::Struct { fields } => fields .iter() .flat_map(|(field_name, field_type)| { diff --git a/compiler/src/passes/select/select.rs b/compiler/src/passes/select/select.rs index 1b95c0f..fdc17d7 100644 --- a/compiler/src/passes/select/select.rs +++ b/compiler/src/passes/select/select.rs @@ -91,7 +91,7 @@ fn entry_block<'p>( /// Creates an exit block for the function. fn exit_block<'p>( - fun: &FunEliminated<'p>, + _fun: &FunEliminated<'p>, blocks: &mut HashMap, Block<'p, VarArg>>>, ) -> UniqueSym<'p> { let exit = gen_sym("exit"); @@ -166,10 +166,6 @@ fn select_assign<'p>( let dst = var!(dsts[0]); match expr.inner { ExprEliminated::Atom { atm, .. } => vec![mov!(select_atom(atm), dst)], - ExprEliminated::Atom { - atm: Atom::Var { sym }, - .. - } => vec![mov!(var!(sym), dst)], ExprEliminated::BinaryOp { op, exprs: [a0, a1], diff --git a/compiler/src/passes/validate/resolve.rs b/compiler/src/passes/validate/resolve.rs index 608e7cf..c7f738d 100644 --- a/compiler/src/passes/validate/resolve.rs +++ b/compiler/src/passes/validate/resolve.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::types::{IntType, Type}; +use crate::passes::parse::types::Type; use crate::passes::parse::{Constrained, Expr, Lit, Meta, Param, Span, Spanned, TypeDef, Typed}; use crate::passes::select::{Instr, InstrSelected, VarArg}; use crate::passes::validate::error::TypeError; @@ -9,7 +9,6 @@ use crate::passes::validate::{ }; use crate::utils::union_find::{UnionFind, UnionIndex}; use crate::utils::unique_sym::UniqueSym; -use crate::*; use functor_derive::Functor; use std::num::ParseIntError; diff --git a/compiler/src/passes/validate/uniquify/expr.rs b/compiler/src/passes/validate/uniquify/expr.rs index b350501..065462e 100644 --- a/compiler/src/passes/validate/uniquify/expr.rs +++ b/compiler/src/passes/validate/uniquify/expr.rs @@ -6,7 +6,6 @@ use crate::passes::validate::uniquify::{gen_spanned_sym, try_get}; use crate::passes::validate::{uniquify, ExprUniquified, InstrUniquified}; use crate::utils::push_map::PushMap; use crate::utils::unique_sym::UniqueSym; -use crate::*; pub fn uniquify_expr<'p>( expr: Spanned>, diff --git a/compiler/tests/aoc.rs b/compiler/tests/aoc.rs index bd0d490..0798b44 100644 --- a/compiler/tests/aoc.rs +++ b/compiler/tests/aoc.rs @@ -39,9 +39,8 @@ fn aoc([program_path, output_path]: [&Path; 2]) { // Wait for output to be executable. let child = loop { - match create_child() { - Ok(child) => break child, - _ => {} + if let Ok(child) = create_child() { + break child; } }; diff --git a/compiler/tests/integration.rs b/compiler/tests/integration.rs index 40a2cf8..8444b51 100644 --- a/compiler/tests/integration.rs +++ b/compiler/tests/integration.rs @@ -32,9 +32,8 @@ fn integration([test]: [&str; 1]) { // Wait for output to be executable. let mut child = loop { - match create_child() { - Ok(child) => break child, - _ => {} + if let Ok(child) = create_child() { + break child; } };