Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove missing todos #1055

Merged
merged 9 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/bin/utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ fn jitvalue_to_felt(value: &Value) -> Vec<Felt> {
felts
}
} else {
todo!()
// Assume its a regular enum.
let mut felts = vec![(*tag).into()];
felts.extend(jitvalue_to_felt(value));
felts
}
}
Value::Felt252Dict { value, .. } => {
Expand Down
2 changes: 1 addition & 1 deletion src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,7 @@ fn compile_func(
}
})
.collect::<Result<Vec<_>, _>>()?,
None => todo!(),
None => native_panic!("not yet implemented"),
};

block.append_operation(cf::cond_br(
Expand Down
4 changes: 2 additions & 2 deletions src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RangeCheck96 is a builtin, therefore should go in the builtins category (the block just above, after RangeCheck).

// 2.9.0
CoreTypeConcrete::IntRange(_) => todo!(),
CoreTypeConcrete::IntRange(_) => native_panic!("not yet implemented as results"),
}
}

Expand Down
31 changes: 15 additions & 16 deletions src/libfuncs/const.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(_)
Expand All @@ -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),
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/libfuncs/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use super::{BlockExt, LibfuncHelper};
use crate::{
error::Result,
metadata::MetadataStorage,
native_panic,
types::TypeBuilder,
utils::{ProgramRegistryExt, PRIME},
};
Expand Down Expand Up @@ -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)?;
Expand Down
4 changes: 1 addition & 3 deletions src/types/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,6 @@ pub fn layout(

Ok(layout)
}
CircuitTypeConcrete::CircuitPartialOutputs(_) => {
todo!("CircuitPartialOutputs is noop for now")
}
CircuitTypeConcrete::CircuitPartialOutputs(_) => Ok(Layout::new::<()>()),
}
}
Loading