diff --git a/src/bin/utils/mod.rs b/src/bin/utils/mod.rs index b4cce9a1f..160d647b5 100644 --- a/src/bin/utils/mod.rs +++ b/src/bin/utils/mod.rs @@ -134,7 +134,10 @@ fn jitvalue_to_felt(value: &Value) -> Vec { felts } } else { - todo!() + // Assume its a regular enum. + let mut felts = vec![(*tag).into()]; + felts.extend(jitvalue_to_felt(value)); + felts } } Value::Felt252Dict { value, .. } => { diff --git a/src/compiler.rs b/src/compiler.rs index ebd9b5949..dbe929b69 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -758,7 +758,7 @@ fn compile_func( } }) .collect::, _>>()?, - None => todo!(), + None => native_panic!("not yet implemented"), }; block.append_operation(cf::cond_br( diff --git a/src/executor.rs b/src/executor.rs index 8aaf2d9fe..994ffa228 100644 --- a/src/executor.rs +++ b/src/executor.rs @@ -635,9 +635,9 @@ fn parse_result( | CoreTypeConcrete::StarkNet(_) | CoreTypeConcrete::Uint128MulGuarantee(_) | CoreTypeConcrete::Circuit(_) - | CoreTypeConcrete::RangeCheck96(_) => todo!(), + | CoreTypeConcrete::RangeCheck96(_) => native_panic!("not yet implemented as results"), // 2.9.0 - CoreTypeConcrete::IntRange(_) => todo!(), + CoreTypeConcrete::IntRange(_) => native_panic!("not yet implemented as results"), } } diff --git a/src/libfuncs/const.rs b/src/libfuncs/const.rs index 5efd9a6e0..a13622833 100644 --- a/src/libfuncs/const.rs +++ b/src/libfuncs/const.rs @@ -269,23 +269,22 @@ pub fn build_const_type_value<'ctx, 'this>( entry.const_int_from_type(context, location, value, inner_ty) } - CoreTypeConcrete::StarkNet(starnet_type) => match starnet_type { - StarkNetTypeConcrete::ClassHash(_) | StarkNetTypeConcrete::ContractAddress(_) => { - let value = match &info.inner_data.as_slice() { - [GenericArg::Value(value)] => value.clone(), - _ => return Err(Error::ConstDataMismatch), - }; + CoreTypeConcrete::StarkNet( + StarkNetTypeConcrete::ClassHash(_) | StarkNetTypeConcrete::ContractAddress(_), + ) => { + let value = match &info.inner_data.as_slice() { + [GenericArg::Value(value)] => value.clone(), + _ => return Err(Error::ConstDataMismatch), + }; - let (sign, value) = value.into_parts(); - let value = match sign { - Sign::Minus => PRIME.clone() - value, - _ => value, - }; + let (sign, value) = value.into_parts(); + let value = match sign { + Sign::Minus => PRIME.clone() - value, + _ => value, + }; - entry.const_int_from_type(context, location, value, inner_ty) - } - _ => native_panic!("const for type {} not implemented", info.inner_ty), - }, + entry.const_int_from_type(context, location, value, inner_ty) + } CoreTypeConcrete::Uint8(_) | CoreTypeConcrete::Uint16(_) | CoreTypeConcrete::Uint32(_) @@ -302,7 +301,7 @@ pub fn build_const_type_value<'ctx, 'this>( } _ => Err(Error::ConstDataMismatch), }, - _ => todo!("const for type {}", info.inner_ty), + _ => native_panic!("const for type {} not implemented", info.inner_ty), } } diff --git a/src/libfuncs/int.rs b/src/libfuncs/int.rs index f098a14b5..919876910 100644 --- a/src/libfuncs/int.rs +++ b/src/libfuncs/int.rs @@ -2,6 +2,7 @@ use super::{BlockExt, LibfuncHelper}; use crate::{ error::Result, metadata::MetadataStorage, + native_panic, types::TypeBuilder, utils::{ProgramRegistryExt, PRIME}, }; @@ -636,7 +637,7 @@ fn build_square_root<'ctx, 'this>( CoreTypeConcrete::Uint32(_) => (32, 16), CoreTypeConcrete::Uint64(_) => (64, 32), CoreTypeConcrete::Uint128(_) => (128, 64), - _ => unreachable!(), + _ => native_panic!("invalid value type in int square root"), }; let k1 = entry.const_int(context, location, 1, input_bits)?; diff --git a/src/types/circuit.rs b/src/types/circuit.rs index 467e86956..b8b9c93a4 100644 --- a/src/types/circuit.rs +++ b/src/types/circuit.rs @@ -279,8 +279,6 @@ pub fn layout( Ok(layout) } - CircuitTypeConcrete::CircuitPartialOutputs(_) => { - todo!("CircuitPartialOutputs is noop for now") - } + CircuitTypeConcrete::CircuitPartialOutputs(_) => Ok(Layout::new::<()>()), } }