cairo-native 0.8.0

A compiler to convert Cairo's IR Sierra code to MLIR and execute it.
1
2
3
4
5
6
7
8
9
10
11
12
13
use zeroable::IsZeroResult;
use zeroable::NonZeroIntoImpl;

fn main() -> felt252 {
    NonZeroIntoImpl::into(felt_to_nonzero(1234))
}

fn felt_to_nonzero(value: felt252) -> NonZero<felt252> {
    match felt252_is_zero(value) {
        IsZeroResult::Zero(()) => panic(ArrayTrait::new()),
        IsZeroResult::NonZero(x) => x,
    }
}