diff --git a/Cargo.lock b/Cargo.lock index ad3bb9781..656944bdc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,9 +54,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -69,36 +69,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -118,7 +118,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -310,7 +310,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.83", + "syn 2.0.85", "which", ] @@ -331,7 +331,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -620,7 +620,7 @@ checksum = "d72f17373740f242d6995e896b9195c2cedff7e8b14e496afdd16b405039d1fb" dependencies = [ "cairo-lang-debug", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -1183,7 +1183,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -1194,9 +1194,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" @@ -1406,7 +1406,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -1417,7 +1417,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -1484,7 +1484,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -1494,7 +1494,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -1565,7 +1565,7 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -1612,7 +1612,7 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -1727,7 +1727,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -1785,7 +1785,7 @@ checksum = "553630feadf7b76442b0849fd25fdf89b860d933623aec9693fed19af0400c78" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -2234,9 +2234,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libredox" @@ -2335,7 +2335,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.83", + "syn 2.0.85", "tblgen-alt", "unindent", ] @@ -2646,9 +2646,9 @@ checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2739,12 +2739,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "910d41a655dac3b764f1ade94821093d3610248694320cd072303a8eedcf221d" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -2917,9 +2917,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -3007,7 +3007,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.83", + "syn 2.0.85", "unicode-ident", ] @@ -3037,7 +3037,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -3067,9 +3067,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags", "errno", @@ -3113,9 +3113,9 @@ dependencies = [ [[package]] name = "scarb-metadata" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170ebce1774a85568646ba4096827f898306665187eebd9282fee313e316518d" +checksum = "1a8b71f63999dbb6d269fbc6fd61310016ab3a160fb13e52a6511a2b904359f0" dependencies = [ "camino", "semver", @@ -3163,7 +3163,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -3183,22 +3183,22 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.213" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.213" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -3209,7 +3209,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -3371,7 +3371,7 @@ checksum = "bbc159a1934c7be9761c237333a57febe060ace2bc9e3b337a59a37af206d19f" dependencies = [ "starknet-curve 0.4.2", "starknet-ff", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -3463,9 +3463,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.83" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01680f5d178a369f817f43f3d399650272873a8e7588a7872f7e90edc71d60a3" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -3532,7 +3532,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -3543,7 +3543,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", "test-case-core", ] @@ -3564,7 +3564,7 @@ checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -3703,7 +3703,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -3917,7 +3917,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", "wasm-bindgen-shared", ] @@ -3939,7 +3939,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4208,7 +4208,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] @@ -4228,7 +4228,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.83", + "syn 2.0.85", ] [[package]] diff --git a/src/libfuncs/felt252.rs b/src/libfuncs/felt252.rs index 351650ce4..7c90ea948 100644 --- a/src/libfuncs/felt252.rs +++ b/src/libfuncs/felt252.rs @@ -326,7 +326,7 @@ pub fn build_const<'ctx, 'this>( info: &Felt252ConstConcreteLibfunc, ) -> Result<()> { let value = match info.c.sign() { - Sign::Minus => (&info.c + BigInt::from_biguint(Sign::Minus, PRIME.clone())) + Sign::Minus => (&info.c + BigInt::from_biguint(Sign::Plus, PRIME.clone())) .magnitude() .clone(), _ => info.c.magnitude().clone(), @@ -406,8 +406,15 @@ pub mod test { // TODO: Add test program for `felt252_div_const`. static ref FELT252_CONST: (String, Program) = load_cairo! { + extern fn felt252_const() -> felt252 nopanic; + fn run_test() -> (felt252, felt252, felt252, felt252) { - (0, 1, -2, -1) + ( + felt252_const::<0>(), + felt252_const::<1>(), + felt252_const::<-2>(), + felt252_const::<-1>() + ) } };