Skip to content

Commit 7db7640

Browse files
authored
Merge main into dev v2.12.0 (#7945)
2 parents 74a8ff0 + d0492b9 commit 7db7640

File tree

284 files changed

+37332
-35914
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+37332
-35914
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: dtolnay/rust-toolchain@master
1616
with:
17-
toolchain: nightly-2025-05-20
17+
toolchain: nightly-2025-07-08
1818
targets: wasm32-unknown-unknown
1919
- uses: Swatinem/rust-cache@v2
2020
- run: |
@@ -67,7 +67,7 @@ jobs:
6767
- uses: dtolnay/rust-toolchain@master
6868
with:
6969
components: rustfmt
70-
toolchain: nightly-2025-05-20
70+
toolchain: nightly-2025-07-08
7171
- uses: dtolnay/rust-toolchain@stable
7272
- uses: Swatinem/rust-cache@v2
7373
- name: Install nextest
@@ -101,7 +101,7 @@ jobs:
101101
- uses: dtolnay/rust-toolchain@master
102102
with:
103103
components: rustfmt
104-
toolchain: nightly-2025-05-20
104+
toolchain: nightly-2025-07-08
105105
- uses: Swatinem/rust-cache@v2
106106
- run: scripts/rust_fmt.sh --check
107107

@@ -140,7 +140,7 @@ jobs:
140140
- uses: dtolnay/rust-toolchain@master
141141
with:
142142
components: clippy
143-
toolchain: nightly-2025-05-20
143+
toolchain: nightly-2025-07-08
144144
- uses: Swatinem/rust-cache@v2
145145
- run: >
146146
scripts/clippy.sh
@@ -157,7 +157,7 @@ jobs:
157157
- uses: actions/checkout@v4
158158
- uses: dtolnay/rust-toolchain@master
159159
with:
160-
toolchain: nightly-2025-05-20
160+
toolchain: nightly-2025-07-08
161161
- uses: Swatinem/rust-cache@v2
162162
- run: >
163163
scripts/docs.sh

Cargo.lock

Lines changed: 11 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ ark-secp256r1 = "0.5.0"
8989
ark-std = "0.5.0"
9090
assert_matches = "1.5"
9191
bimap = "0.6.3"
92-
bincode = "1.3.3"
92+
bincode = { version = "2", features = ["serde"] }
9393
cairo-lang-primitive-token = "1"
9494
cairo-vm = { version = "2.0.1", features = ["mod_builtin"] }
9595
clap = { version = "4.5.29", features = ["derive"] }
@@ -153,5 +153,6 @@ tokio = { version = "1.43.0", features = ["full", "sync"] }
153153
toml = "0.8.20"
154154
unescaper = "0.1.5"
155155
xshell = "0.2.7"
156+
xxhash-rust = { version = "0.8", features = ["xxh3"] }
156157

157158
openssl = { version = "0.10.71" }

adrs/002_let_and_assign.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This is opposed to "let"/"var" in other languages, that are effectively, shadowi
1919
- May change type.
2020
- Do not affect outer scopes.
2121

22-
The rebinding in Cairo0 acts more like assignment in other languages.
22+
The rebinding in Cairo0 acts more like an assignment in other languages.
2323

2424
### Proposal
2525

@@ -30,7 +30,7 @@ Two syntaxes: "let", and "assign".
3030
- _Assign_ - `<ident> = <expr>`. Does not change the definition of `<ident>`. Inner and outer scopes
3131
still see the previous definition, but with a new value.
3232

33-
This behavior is in line with Rust.
33+
This behavior aligns with Rust.
3434

3535
_Shadowing_ - although the language will permit this, a specific warning will be emitted in such
3636
cases. Whether the compilation will pass is up to configuration.

corelib/src/array.cairo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ pub impl SpanImpl<T> of SpanTrait<T> {
475475
/// assert!(span.pop_front() == Some(@1));
476476
/// ```
477477
#[inline]
478-
fn pop_front(ref self: Span<T>) -> Option<@T> {
478+
fn pop_front(ref self: Span<T>) -> Option<@T> nopanic {
479479
let mut snapshot = self.snapshot;
480480
let item = array_snapshot_pop_front(ref snapshot);
481481
self = Span { snapshot };

corelib/src/internal.cairo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extern fn trace<const FLAG: felt252>() nopanic;
1515
feature: "bounded-int-utils",
1616
note: "Improper usage of the functionalities in this module is likely to cause compiler crashes, use with caution.",
1717
)]
18-
pub(crate) mod bounded_int;
18+
pub mod bounded_int;
1919

2020
mod num;
2121

corelib/src/starknet.cairo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,4 +147,6 @@ impl SyscallResultTraitImpl<T> of SyscallResultTrait<T> {
147147
/// signal that the transaction should proceed.
148148
pub const VALIDATED: felt252 = 'VALID';
149149

150+
pub mod deployment;
151+
150152
pub mod testing;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/// Configuration for contract deployment
2+
///
3+
/// This structure contains parameters needed to deploy a new contract instance
4+
/// It is used by typed deployment function generated by starknet cairo plugin
5+
#[cfg(target: 'test')]
6+
#[derive(Drop, Copy, Debug, PartialEq, Serde, Default)]
7+
pub struct DeploymentParams {
8+
/// The salt, an arbitrary value provided by the deployer, used in the computation of the
9+
/// contract's address.
10+
pub salt: felt252,
11+
/// Deploy the contract from the zero address.
12+
pub deploy_from_zero: bool,
13+
}

corelib/src/test.cairo

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ mod hash_test;
1717
mod integer_test;
1818
mod iter_test;
1919
mod keccak_test;
20+
mod let_else_test;
2021
mod math_test;
2122
mod nullable_test;
2223
mod num_test;

corelib/src/test/language_features/const_folding_test.cairo

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[feature("bounded-int-utils")]
2+
use core::internal::bounded_int::{BoundedInt, constrain};
13
use crate::integer::i8_diff;
24
use crate::num::traits::{WrappingAdd, WrappingMul, WrappingSub};
35

@@ -49,3 +51,9 @@ fn test_mul() {
4951
WrappingMul::wrapping_mul(100_u8, 200) == WrappingMul::wrapping_mul(noop(100), noop(200)),
5052
);
5153
}
54+
55+
#[test]
56+
fn test_implied_non_zero() -> Result<NonZero<BoundedInt<-0x80, -1>>, NonZero<BoundedInt<0, 0x7f>>> {
57+
let x: NonZero<i8> = 5;
58+
constrain::<_, 0>(x)
59+
}

0 commit comments

Comments
 (0)