diff --git a/compiler/src/passes/atomize/mod.rs b/compiler/src/passes/atomize/mod.rs index 9746fba..689100d 100644 --- a/compiler/src/passes/atomize/mod.rs +++ b/compiler/src/passes/atomize/mod.rs @@ -1,9 +1,9 @@ pub mod atomize; use crate::passes::parse::types::Type; -use crate::passes::parse::{BinaryOp, Def, Meta, Typed, UnaryOp}; +use crate::passes::parse::{BinaryOp, Def, Typed, UnaryOp}; use crate::passes::select::std_lib::Std; -use crate::passes::validate::{DefValidated, ExprValidated, PrgValidated, TLit}; +use crate::passes::validate::{TLit}; use crate::utils::gen_sym::UniqueSym; use std::collections::HashMap; use crate::passes::select::{Instr, VarArg}; diff --git a/compiler/src/passes/patch/patch.rs b/compiler/src/passes/patch/patch.rs index 8dcc3ec..7d0b922 100644 --- a/compiler/src/passes/patch/patch.rs +++ b/compiler/src/passes/patch/patch.rs @@ -20,7 +20,7 @@ impl<'p> X86Assigned<'p> { } } -fn patch_block<'p>(block: Block<'p, Arg>) -> Block<'p, Arg> { +fn patch_block(block: Block<'_, Arg>) -> Block<'_, Arg> { Block { instrs: block .instrs @@ -30,7 +30,7 @@ fn patch_block<'p>(block: Block<'p, Arg>) -> Block<'p, Arg> { } } -fn patch_instr<'p>(instr: Instr>) -> Vec>> { +fn patch_instr(instr: Instr>) -> Vec>> { match instr { Instr::Addq { src, dst } => patch_args(src, dst, |src, dst| addq!(src, dst)), Instr::Subq { src, dst } => patch_args(src, dst, |src, dst| subq!(src, dst)), diff --git a/compiler/src/passes/reveal/mod.rs b/compiler/src/passes/reveal/mod.rs index e2df30a..8c64da2 100644 --- a/compiler/src/passes/reveal/mod.rs +++ b/compiler/src/passes/reveal/mod.rs @@ -1,10 +1,10 @@ pub mod reveal; -use crate::passes::parse::{BinaryOp, Def, Meta, Typed, UnaryOp}; +use crate::passes::parse::{BinaryOp, Def, Typed, UnaryOp}; use crate::passes::select::std_lib::Std; -use crate::passes::validate::{DefValidated, ExprValidated, PrgValidated, TLit}; +use crate::passes::validate::{TLit}; use crate::utils::gen_sym::UniqueSym; -use functor_derive::Functor; + use std::collections::HashMap; use crate::passes::select::{Instr, VarArg}; diff --git a/compiler/src/passes/select/select.rs b/compiler/src/passes/select/select.rs index 4c0174d..75345c9 100644 --- a/compiler/src/passes/select/select.rs +++ b/compiler/src/passes/select/select.rs @@ -211,7 +211,7 @@ fn select_assign<'p>( } } -fn select_atom<'p>(expr: Atom<'p>) -> VarArg> { +fn select_atom(expr: Atom<'_>) -> VarArg> { match expr { Atom::Val { val } => imm!(val), Atom::Var { sym } => var!(sym), diff --git a/compiler/src/passes/validate/constrain/access_field.rs b/compiler/src/passes/validate/constrain/access_field.rs index 953c043..7abed4b 100644 --- a/compiler/src/passes/validate/constrain/access_field.rs +++ b/compiler/src/passes/validate/constrain/access_field.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span, Spanned, TypeDef}; +use crate::passes::parse::{Constrained, Span, Spanned, TypeDef}; use crate::passes::validate::constrain::expr::constrain_expr; use crate::passes::validate::constrain::uncover_globals::{Env, EnvEntry}; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/apply.rs b/compiler/src/passes/validate/constrain/apply.rs index b146b90..7ad4584 100644 --- a/compiler/src/passes/validate/constrain/apply.rs +++ b/compiler/src/passes/validate/constrain/apply.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{Constrained, Span, Spanned}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/asm.rs b/compiler/src/passes/validate/constrain/asm.rs index 38febe9..114fd61 100644 --- a/compiler/src/passes/validate/constrain/asm.rs +++ b/compiler/src/passes/validate/constrain/asm.rs @@ -1,10 +1,10 @@ -use crate::passes::parse::{Constrained, Span, Spanned}; -use crate::passes::select::{Instr, VarArg}; +use crate::passes::parse::{Constrained, Span}; + use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; use crate::passes::validate::partial_type::PartialType; use crate::passes::validate::{ExprConstrained, InstrUniquified, MetaConstrained}; -use crate::utils::gen_sym::UniqueSym; + pub fn constrain_asm<'p>( env: &mut Env<'_, 'p>, diff --git a/compiler/src/passes/validate/constrain/assign.rs b/compiler/src/passes/validate/constrain/assign.rs index da75c04..7741ba0 100644 --- a/compiler/src/passes/validate/constrain/assign.rs +++ b/compiler/src/passes/validate/constrain/assign.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{Constrained, Span, Spanned}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::{Env, EnvEntry}; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/binary_op.rs b/compiler/src/passes/validate/constrain/binary_op.rs index 4a8c10c..7dc760f 100644 --- a/compiler/src/passes/validate/constrain/binary_op.rs +++ b/compiler/src/passes/validate/constrain/binary_op.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{BinaryOp, Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{BinaryOp, Constrained, Span, Spanned}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/break.rs b/compiler/src/passes/validate/constrain/break.rs index 4aad592..93124fd 100644 --- a/compiler/src/passes/validate/constrain/break.rs +++ b/compiler/src/passes/validate/constrain/break.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{Constrained, Span, Spanned}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/continue.rs b/compiler/src/passes/validate/constrain/continue.rs index adc656a..21aa189 100644 --- a/compiler/src/passes/validate/constrain/continue.rs +++ b/compiler/src/passes/validate/constrain/continue.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span}; +use crate::passes::parse::{Constrained, Span}; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; use crate::passes::validate::partial_type::PartialType; diff --git a/compiler/src/passes/validate/constrain/def.rs b/compiler/src/passes/validate/constrain/def.rs index f91345c..5ba6035 100644 --- a/compiler/src/passes/validate/constrain/def.rs +++ b/compiler/src/passes/validate/constrain/def.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Def, Meta, Spanned}; +use crate::passes::parse::{Def, Spanned}; use crate::passes::validate::constrain::expr::constrain_expr; use crate::passes::validate::constrain::uncover_globals::{Env, EnvEntry}; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/expr.rs b/compiler/src/passes/validate/constrain/expr.rs index 6ba9008..edd9efd 100644 --- a/compiler/src/passes/validate/constrain/expr.rs +++ b/compiler/src/passes/validate/constrain/expr.rs @@ -1,7 +1,7 @@ use crate::passes::parse::{Constrained, Expr, Spanned}; use crate::passes::validate::constrain::access_field::constrain_access_field; use crate::passes::validate::constrain::apply::constrain_apply; -use crate::passes::validate::constrain::asm; + use crate::passes::validate::constrain::asm::constrain_asm; use crate::passes::validate::constrain::assign::constrain_assign; use crate::passes::validate::constrain::binary_op::constrain_binary_op; diff --git a/compiler/src/passes/validate/constrain/if.rs b/compiler/src/passes/validate/constrain/if.rs index 3ceb717..985bbc7 100644 --- a/compiler/src/passes/validate/constrain/if.rs +++ b/compiler/src/passes/validate/constrain/if.rs @@ -1,5 +1,5 @@ use crate::passes::parse::types::Type; -use crate::passes::parse::{Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{Constrained, Span, Spanned}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/let.rs b/compiler/src/passes/validate/constrain/let.rs index 0458f0b..da1f2ab 100644 --- a/compiler/src/passes/validate/constrain/let.rs +++ b/compiler/src/passes/validate/constrain/let.rs @@ -1,5 +1,5 @@ use crate::passes::parse::types::Type; -use crate::passes::parse::{Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{Constrained, Span, Spanned}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::{Env, EnvEntry}; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/lit.rs b/compiler/src/passes/validate/constrain/lit.rs index afd65e0..1a9a5f6 100644 --- a/compiler/src/passes/validate/constrain/lit.rs +++ b/compiler/src/passes/validate/constrain/lit.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Lit, Meta, Span}; +use crate::passes::parse::{Constrained, Lit, Span}; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; use crate::passes::validate::partial_type::PartialType; diff --git a/compiler/src/passes/validate/constrain/loop.rs b/compiler/src/passes/validate/constrain/loop.rs index 6bc9a06..09b97ab 100644 --- a/compiler/src/passes/validate/constrain/loop.rs +++ b/compiler/src/passes/validate/constrain/loop.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{Constrained, Span, Spanned}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/return.rs b/compiler/src/passes/validate/constrain/return.rs index 1eb4f0c..e51a88d 100644 --- a/compiler/src/passes/validate/constrain/return.rs +++ b/compiler/src/passes/validate/constrain/return.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{Constrained, Span, Spanned}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/seq.rs b/compiler/src/passes/validate/constrain/seq.rs index 2064c8d..829de29 100644 --- a/compiler/src/passes/validate/constrain/seq.rs +++ b/compiler/src/passes/validate/constrain/seq.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{Constrained, Span, Spanned}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/struct.rs b/compiler/src/passes/validate/constrain/struct.rs index efb0fe1..fd9c099 100644 --- a/compiler/src/passes/validate/constrain/struct.rs +++ b/compiler/src/passes/validate/constrain/struct.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span, Spanned, TypeDef}; +use crate::passes::parse::{Constrained, Span, Spanned, TypeDef}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::{Env, EnvEntry}; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/unary_op.rs b/compiler/src/passes/validate/constrain/unary_op.rs index 7069730..f446d31 100644 --- a/compiler/src/passes/validate/constrain/unary_op.rs +++ b/compiler/src/passes/validate/constrain/unary_op.rs @@ -1,5 +1,5 @@ use crate::passes::parse::types::Type; -use crate::passes::parse::{Constrained, Meta, Span, Spanned, UnaryOp}; +use crate::passes::parse::{Constrained, Span, Spanned, UnaryOp}; use crate::passes::validate::constrain::expr; use crate::passes::validate::constrain::uncover_globals::Env; use crate::passes::validate::error::TypeError; diff --git a/compiler/src/passes/validate/constrain/var.rs b/compiler/src/passes/validate/constrain/var.rs index 00d802d..eb1dba1 100644 --- a/compiler/src/passes/validate/constrain/var.rs +++ b/compiler/src/passes/validate/constrain/var.rs @@ -1,4 +1,4 @@ -use crate::passes::parse::{Constrained, Meta, Span, Spanned}; +use crate::passes::parse::{Constrained, Span, Spanned}; use crate::passes::validate::constrain::uncover_globals::{Env, EnvEntry}; use crate::passes::validate::error::TypeError; use crate::passes::validate::{ExprConstrained, MetaConstrained}; diff --git a/compiler/src/passes/validate/resolve.rs b/compiler/src/passes/validate/resolve.rs index 231991a..2f2c00c 100644 --- a/compiler/src/passes/validate/resolve.rs +++ b/compiler/src/passes/validate/resolve.rs @@ -1,5 +1,5 @@ use crate::passes::parse::types::Type; -use crate::passes::parse::{Constrained, Expr, Lit, Meta, Param, Spanned, TypeDef, Typed, InstrParsed}; +use crate::passes::parse::{Constrained, Expr, Lit, Meta, Param, Spanned, TypeDef, Typed}; use crate::passes::validate::error::TypeError; use crate::passes::validate::partial_type::PartialType; use crate::passes::validate::{ diff --git a/compiler/src/passes/validate/tests.rs b/compiler/src/passes/validate/tests.rs index beee4a7..2822ae6 100644 --- a/compiler/src/passes/validate/tests.rs +++ b/compiler/src/passes/validate/tests.rs @@ -1,4 +1,4 @@ -use crate::interpreter::TestIO; + use crate::passes::parse::parse::parse_program; use crate::utils::split_test::split_test; use derive_name::VariantName; @@ -6,7 +6,7 @@ use miette::{NamedSource, Report}; use test_each_file::test_each_file; fn validate([test]: [&str; 1], good: bool) { - let (input, expected_output, expected_return, expected_error) = split_test(test); + let (_input, _expected_output, _expected_return, expected_error) = split_test(test); assert_eq!(good, expected_error.is_none()); let result = parse_program(test).unwrap().validate();