From 5a51764cff9f1be282ed8a3ea72129d183989936 Mon Sep 17 00:00:00 2001 From: microproofs Date: Fri, 21 Jul 2023 14:20:59 -0400 Subject: [PATCH] remove some warnings --- crates/aiken-lang/src/gen_uplc2.rs | 3 +++ crates/aiken-lang/src/gen_uplc2/builder.rs | 13 +++---------- crates/aiken-lang/src/gen_uplc2/tree.rs | 4 ++-- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/crates/aiken-lang/src/gen_uplc2.rs b/crates/aiken-lang/src/gen_uplc2.rs index f0a3b83e..73ed0057 100644 --- a/crates/aiken-lang/src/gen_uplc2.rs +++ b/crates/aiken-lang/src/gen_uplc2.rs @@ -2377,6 +2377,7 @@ impl<'a> CodeGenerator<'a> { .functions .get(key) .unwrap_or_else(|| panic!("Missing Function Definition")); + let params = func .arguments .iter() @@ -2399,6 +2400,8 @@ impl<'a> CodeGenerator<'a> { body.clone(), ) .hoist_over(node_to_edit.clone()); + } else { + todo!() } } diff --git a/crates/aiken-lang/src/gen_uplc2/builder.rs b/crates/aiken-lang/src/gen_uplc2/builder.rs index bc17d03d..91e40616 100644 --- a/crates/aiken-lang/src/gen_uplc2/builder.rs +++ b/crates/aiken-lang/src/gen_uplc2/builder.rs @@ -3,10 +3,10 @@ use std::sync::Arc; use indexmap::IndexMap; use crate::{ - ast::{Function, TypedDataType, TypedFunction}, + ast::TypedDataType, builtins::bool, gen_uplc::builder::{lookup_data_type_by_tipo, DataTypeKey, FunctionAccessKey}, - tipo::{TypeVar, ValueConstructorVariant}, + tipo::TypeVar, }; use crate::{ @@ -14,10 +14,7 @@ use crate::{ tipo::Type, }; -use super::{ - air::Air, - tree::{AirExpression, AirStatement, AirTree, TreePath}, -}; +use super::tree::{AirExpression, AirStatement, AirTree}; #[derive(Clone, Debug)] pub enum CodeGenFunction { @@ -330,10 +327,6 @@ pub fn monomorphize(air_tree: &mut AirTree, mono_types: &IndexMap }); } -pub fn function_deps(air_tree: &mut AirTree, mono_types: &IndexMap>) { - air_tree.traverse_tree_with(&mut |air_tree: &mut AirTree, _| {}); -} - pub fn erase_opaque_type_operations( air_tree: &mut AirTree, data_types: &IndexMap, diff --git a/crates/aiken-lang/src/gen_uplc2/tree.rs b/crates/aiken-lang/src/gen_uplc2/tree.rs index 37671c99..91a4f32d 100644 --- a/crates/aiken-lang/src/gen_uplc2/tree.rs +++ b/crates/aiken-lang/src/gen_uplc2/tree.rs @@ -1,5 +1,5 @@ use indexmap::IndexSet; -use std::{borrow::BorrowMut, path, slice::Iter, sync::Arc}; +use std::{borrow::BorrowMut, slice::Iter, sync::Arc}; use uplc::{builder::EXPECT_ON_LIST, builtins::DefaultFunction}; use crate::{ @@ -1751,7 +1751,7 @@ impl AirTree { &'a mut self, tree_path_iter: &mut Iter<(usize, usize)>, ) -> &'a mut AirTree { - if let Some((depth, index)) = tree_path_iter.next() { + if let Some((_depth, index)) = tree_path_iter.next() { let mut children_nodes = vec![]; match self { AirTree::Statement {