Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanBrouwer committed Apr 21, 2024
1 parent 3f6afd9 commit e8d87a9
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 24 deletions.
10 changes: 1 addition & 9 deletions compiler/src/passes/conclude/conclude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
_ => {}
}
Expand Down Expand Up @@ -70,14 +70,6 @@ fn fix_stack_space(block: &mut Block<Arg>, stack_space: usize) {
assert_eq!(*val, 0x1000);
*val = stack_space as i32;
}
InstrAssigned::Add {
src: Arg::Imm(_), ..
}
| InstrAssigned::Sub {
src: Arg::Imm(_), ..
} => {
todo!()
}
_ => {}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/passes/eliminate/eliminate_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)| {
Expand Down
6 changes: 1 addition & 5 deletions compiler/src/passes/select/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<UniqueSym<'p>, Block<'p, VarArg<UniqueSym<'p>>>>,
) -> UniqueSym<'p> {
let exit = gen_sym("exit");
Expand Down Expand Up @@ -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],
Expand Down
3 changes: 1 addition & 2 deletions compiler/src/passes/validate/resolve.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;

Expand Down
1 change: 0 additions & 1 deletion compiler/src/passes/validate/uniquify/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ExprParsed<'p>>,
Expand Down
5 changes: 2 additions & 3 deletions compiler/tests/aoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

Expand Down
5 changes: 2 additions & 3 deletions compiler/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
};

Expand Down

0 comments on commit e8d87a9

Please sign in to comment.