Skip to content

Commit 79ea7e3

Browse files
authored
Update cairo (#2057)
1 parent 2b79c0e commit 79ea7e3

19 files changed

+193
-291
lines changed

Cargo.lock

+93-229
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+62-26
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,29 @@ assert_fs = "1"
4040
async-trait = "0.1"
4141
axum = { version = "0.6", features = ["http2"] }
4242
bincode = "2.0.0"
43-
cairo-lang-compiler = "2.11.2"
44-
cairo-lang-defs = "2.11.2"
45-
cairo-lang-diagnostics = "2.11.2"
46-
cairo-lang-doc = "2.11.2"
47-
cairo-lang-executable = "2.11.2"
48-
cairo-lang-filesystem = "2.11.2"
49-
cairo-lang-formatter = "2.11.2"
50-
cairo-lang-lowering = "2.11.2"
51-
cairo-lang-parser = "2.11.2"
52-
cairo-lang-runner = "2.11.2"
53-
cairo-lang-semantic = "2.11.2"
54-
cairo-lang-sierra = "2.11.2"
55-
cairo-lang-sierra-generator = "2.11.2"
56-
cairo-lang-sierra-to-casm = "2.11.2"
57-
cairo-lang-starknet = "2.11.2"
58-
cairo-lang-starknet-classes = "2.11.2"
59-
cairo-lang-syntax = "2.11.2"
60-
cairo-lang-test-plugin = "2.11.2"
61-
cairo-lang-test-runner = "2.11.2"
62-
cairo-lang-utils = { version = "2.11.2", features = ["env_logger"] }
63-
cairo-language-server = "2.11.2"
64-
cairo-lint-core = "2.11.2"
65-
cairo-vm = "1.0.1"
43+
cairo-lang-compiler = "*"
44+
cairo-lang-defs = "*"
45+
cairo-lang-diagnostics = "*"
46+
cairo-lang-doc = "*"
47+
cairo-lang-executable = "*"
48+
cairo-lang-filesystem = "*"
49+
cairo-lang-formatter = "*"
50+
cairo-lang-lowering = "*"
51+
cairo-lang-parser = "*"
52+
cairo-lang-runner = "*"
53+
cairo-lang-semantic = "*"
54+
cairo-lang-sierra = "*"
55+
cairo-lang-sierra-generator = "*"
56+
cairo-lang-sierra-to-casm = "*"
57+
cairo-lang-starknet = "*"
58+
cairo-lang-starknet-classes = "*"
59+
cairo-lang-syntax = "*"
60+
cairo-lang-test-plugin = "*"
61+
cairo-lang-test-runner = "*"
62+
cairo-lang-utils = { version = "*", features = ["env_logger"] }
63+
cairo-language-server = "*"
64+
cairo-lint-core = "*"
65+
cairo-vm = "2.0.0"
6666
camino = { version = "1", features = ["serde1"] }
6767
cargo_metadata = ">=0.18"
6868
clap = { version = "4", features = ["derive", "env", "string"] }
@@ -117,11 +117,11 @@ serde_test = "1"
117117
sha2 = "0.10"
118118
similar-asserts = { version = "1", features = ["serde"] }
119119
smallvec = "1"
120-
smol_str = { version = "0.2", features = ["serde"] }
120+
smol_str = { version = "0.3", features = ["serde"] }
121121
snapbox = { version = "0.4", features = ["cmd", "path"] }
122122
starknet-types-core = "0.1"
123-
stwo-cairo-adapter = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "08ddec7125cd77104b3e0e3a84298a9d988778dd", features = ["std"] }
124-
stwo_cairo_prover = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "08ddec7125cd77104b3e0e3a84298a9d988778dd" }
123+
stwo-cairo-adapter = { version = "*", features = ["std"] }
124+
stwo_cairo_prover = "*"
125125
syn = "2"
126126
tar = "0.4"
127127
target-triple = "0.1"
@@ -148,6 +148,42 @@ zip = { version = "0.6", default-features = false, features = ["deflate"] }
148148
zstd = "0.13"
149149

150150
[patch.crates-io]
151+
cairo-lang-casm = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
152+
cairo-lang-compiler = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
153+
cairo-lang-debug = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
154+
cairo-lang-defs = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
155+
cairo-lang-diagnostics = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
156+
cairo-lang-doc = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
157+
cairo-lang-eq-solver = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
158+
cairo-lang-executable = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
159+
cairo-lang-filesystem = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
160+
cairo-lang-formatter = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
161+
cairo-lang-lowering = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
162+
cairo-lang-parser = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
163+
cairo-lang-plugins = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
164+
cairo-lang-proc-macros = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
165+
cairo-lang-project = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
166+
cairo-lang-runnable-utils = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
167+
cairo-lang-runner = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
168+
cairo-lang-semantic = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
169+
cairo-lang-sierra = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
170+
cairo-lang-sierra-ap-change = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
171+
cairo-lang-sierra-gas = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
172+
cairo-lang-sierra-generator = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
173+
cairo-lang-sierra-to-casm = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
174+
cairo-lang-sierra-type-size = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
175+
cairo-lang-starknet = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
176+
cairo-lang-starknet-classes = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
177+
cairo-lang-syntax = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
178+
cairo-lang-syntax-codegen = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
179+
cairo-lang-test-plugin = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
180+
cairo-lang-test-runner = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
181+
cairo-lang-test-utils = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
182+
cairo-lang-utils = { git = "https://github.com/starkware-libs/cairo", rev = "76e8c943895c904da121fb0f6e48551d367e64d8" }
183+
cairo-language-server = { git = "https://github.com/software-mansion/cairols", rev = "7b26a0edc124028781a92e68de24882faea0d885" }
184+
cairo-lint-core = { git = "https://github.com/software-mansion/cairo-lint", rev = "136ae392703c6ee6a8ad41b7b5e1329b8b9a7604" }
185+
stwo-cairo-adapter = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "08ddec7125cd77104b3e0e3a84298a9d988778dd" }
186+
stwo_cairo_prover = { git = "https://github.com/starkware-libs/stwo-cairo", rev = "08ddec7125cd77104b3e0e3a84298a9d988778dd" }
151187

152188
[profile.release]
153189
lto = true

extensions/scarb-doc/src/types.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ impl ItemData {
474474
id: documentable_item_id,
475475
name: id.name(db).into(),
476476
doc: db.get_item_documentation_as_tokens(documentable_item_id),
477-
signature: Some(db.get_item_signature(documentable_item_id)),
477+
signature: db.get_item_signature(documentable_item_id),
478478
full_path: id.full_path(db),
479479
parent_full_path: Some(id.parent_module(db).full_path(db)),
480480
}

extensions/scarb-doc/tests/data/hello_world_no_features/src/hello_world-CircleDrop.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
Fully qualified path: `hello_world::CircleDrop`
44

5-
<pre><code class="language-rust">impl CircleDrop&lt;&gt; of core::traits::Drop&lt;Circle&gt;;</code></pre>
5+
<pre><code class="language-rust">impl CircleDrop of Drop&lt;Circle&gt;;</code></pre>
66

extensions/scarb-doc/tests/data/hello_world_no_features/src/hello_world-CirclePartialEq.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
Fully qualified path: `hello_world::CirclePartialEq`
44

5-
<pre><code class="language-rust">impl CirclePartialEq&lt;&gt; of core::traits::PartialEq&lt;Circle&gt;</code></pre>
5+
<pre><code class="language-rust">impl CirclePartialEq of PartialEq&lt;Circle&gt;;</code></pre>
66

77
## Impl functions
88

99
### eq
1010

1111
Fully qualified path: `hello_world::CirclePartialEq::eq`
1212

13-
<pre><code class="language-rust">fn eq(lhs: @Circle, rhs: @Circle) -&gt; bool</code></pre>
13+
<pre><code class="language-rust">fn eq(lhs: Circle, rhs: Circle) -&gt; bool</code></pre>
1414

1515

extensions/scarb-doc/tests/data/hello_world_no_features/src/hello_world-CircleSerde.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
Fully qualified path: `hello_world::CircleSerde`
44

5-
<pre><code class="language-rust">impl CircleSerde&lt;&gt; of core::serde::Serde&lt;Circle&gt;</code></pre>
5+
<pre><code class="language-rust">impl CircleSerde of Serde&lt;Circle&gt;;</code></pre>
66

77
## Impl functions
88

99
### serialize
1010

1111
Fully qualified path: `hello_world::CircleSerde::serialize`
1212

13-
<pre><code class="language-rust">fn serialize(self: @Circle, ref output: core::array::Array&lt;felt252&gt;)</code></pre>
13+
<pre><code class="language-rust">fn serialize(self: Circle, ref output: Array&lt;felt252&gt;)</code></pre>
1414

1515

1616
### deserialize
1717

1818
Fully qualified path: `hello_world::CircleSerde::deserialize`
1919

20-
<pre><code class="language-rust">fn deserialize(ref serialized: core::array::Span&lt;felt252&gt;) -&gt; core::option::Option&lt;Circle&gt;</code></pre>
20+
<pre><code class="language-rust">fn deserialize(ref serialized: Span&lt;felt252&gt;) -&gt; Option&lt;Circle&gt;</code></pre>
2121

2222

extensions/scarb-doc/tests/data/hello_world_no_features/src/hello_world-CircleShape.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Implementation of the Shape trait for Circle
44

55
Fully qualified path: `hello_world::CircleShape`
66

7-
<pre><code class="language-rust">impl CircleShape of Shape&lt;Circle&gt;</code></pre>
7+
<pre><code class="language-rust">impl CircleShape of Shape&lt;Circle&gt;;</code></pre>
88

99
## Impl constants
1010

extensions/scarb-doc/tests/data/hello_world_no_features/src/hello_world-Color.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Color enum with Red, Green, and Blue variants
55
Fully qualified path: `hello_world::Color`
66

77
<pre><code class="language-rust">enum Color {
8-
Red: (),
9-
Green: (),
10-
Blue: (),
8+
Red,
9+
Green,
10+
Blue,
1111
}</code></pre>
1212

1313
## Variants
@@ -18,7 +18,7 @@ Red color
1818

1919
Fully qualified path: `hello_world::Color::Red`
2020

21-
<pre><code class="language-rust">Red : ( )</code></pre>
21+
<pre><code class="language-rust">Red</code></pre>
2222

2323

2424
### Green
@@ -27,7 +27,7 @@ Green color
2727

2828
Fully qualified path: `hello_world::Color::Green`
2929

30-
<pre><code class="language-rust">Green : ( )</code></pre>
30+
<pre><code class="language-rust">Green</code></pre>
3131

3232

3333
### Blue
@@ -36,6 +36,6 @@ Blue color
3636

3737
Fully qualified path: `hello_world::Color::Blue`
3838

39-
<pre><code class="language-rust">Blue : ( )</code></pre>
39+
<pre><code class="language-rust">Blue</code></pre>
4040

4141

extensions/scarb-doc/tests/data/hello_world_no_features/src/hello_world-Shape.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Calculate the area of the shape
2525

2626
Fully qualified path: `hello_world::Shape::area`
2727

28-
<pre><code class="language-rust">fn area(self: T) -&gt; u32</code></pre>
28+
<pre><code class="language-rust">fn area&lt;T, T&gt;(self: T) -&gt; u32</code></pre>
2929

3030

3131
## Trait types

extensions/scarb-doc/tests/data/hello_world_with_features/src/hello_world-CircleDrop.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
Fully qualified path: `hello_world::CircleDrop`
44

5-
<pre><code class="language-rust">impl CircleDrop&lt;&gt; of core::traits::Drop&lt;Circle&gt;;</code></pre>
5+
<pre><code class="language-rust">impl CircleDrop of Drop&lt;Circle&gt;;</code></pre>
66

extensions/scarb-doc/tests/data/hello_world_with_features/src/hello_world-CirclePartialEq.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
Fully qualified path: `hello_world::CirclePartialEq`
44

5-
<pre><code class="language-rust">impl CirclePartialEq&lt;&gt; of core::traits::PartialEq&lt;Circle&gt;</code></pre>
5+
<pre><code class="language-rust">impl CirclePartialEq of PartialEq&lt;Circle&gt;;</code></pre>
66

77
## Impl functions
88

99
### eq
1010

1111
Fully qualified path: `hello_world::CirclePartialEq::eq`
1212

13-
<pre><code class="language-rust">fn eq(lhs: @Circle, rhs: @Circle) -&gt; bool</code></pre>
13+
<pre><code class="language-rust">fn eq(lhs: Circle, rhs: Circle) -&gt; bool</code></pre>
1414

1515

extensions/scarb-doc/tests/data/hello_world_with_features/src/hello_world-CircleSerde.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
Fully qualified path: `hello_world::CircleSerde`
44

5-
<pre><code class="language-rust">impl CircleSerde&lt;&gt; of core::serde::Serde&lt;Circle&gt;</code></pre>
5+
<pre><code class="language-rust">impl CircleSerde of Serde&lt;Circle&gt;;</code></pre>
66

77
## Impl functions
88

99
### serialize
1010

1111
Fully qualified path: `hello_world::CircleSerde::serialize`
1212

13-
<pre><code class="language-rust">fn serialize(self: @Circle, ref output: core::array::Array&lt;felt252&gt;)</code></pre>
13+
<pre><code class="language-rust">fn serialize(self: Circle, ref output: Array&lt;felt252&gt;)</code></pre>
1414

1515

1616
### deserialize
1717

1818
Fully qualified path: `hello_world::CircleSerde::deserialize`
1919

20-
<pre><code class="language-rust">fn deserialize(ref serialized: core::array::Span&lt;felt252&gt;) -&gt; core::option::Option&lt;Circle&gt;</code></pre>
20+
<pre><code class="language-rust">fn deserialize(ref serialized: Span&lt;felt252&gt;) -&gt; Option&lt;Circle&gt;</code></pre>
2121

2222

extensions/scarb-doc/tests/data/hello_world_with_features/src/hello_world-CircleShape.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Implementation of the Shape trait for Circle
44

55
Fully qualified path: `hello_world::CircleShape`
66

7-
<pre><code class="language-rust">impl CircleShape of Shape&lt;Circle&gt;</code></pre>
7+
<pre><code class="language-rust">impl CircleShape of Shape&lt;Circle&gt;;</code></pre>
88

99
## Impl constants
1010

extensions/scarb-doc/tests/data/hello_world_with_features/src/hello_world-Color.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Color enum with Red, Green, and Blue variants
55
Fully qualified path: `hello_world::Color`
66

77
<pre><code class="language-rust">enum Color {
8-
Red: (),
9-
Green: (),
10-
Blue: (),
8+
Red,
9+
Green,
10+
Blue,
1111
}</code></pre>
1212

1313
## Variants
@@ -18,7 +18,7 @@ Red color
1818

1919
Fully qualified path: `hello_world::Color::Red`
2020

21-
<pre><code class="language-rust">Red : ( )</code></pre>
21+
<pre><code class="language-rust">Red</code></pre>
2222

2323

2424
### Green
@@ -27,7 +27,7 @@ Green color
2727

2828
Fully qualified path: `hello_world::Color::Green`
2929

30-
<pre><code class="language-rust">Green : ( )</code></pre>
30+
<pre><code class="language-rust">Green</code></pre>
3131

3232

3333
### Blue
@@ -36,6 +36,6 @@ Blue color
3636

3737
Fully qualified path: `hello_world::Color::Blue`
3838

39-
<pre><code class="language-rust">Blue : ( )</code></pre>
39+
<pre><code class="language-rust">Blue</code></pre>
4040

4141

extensions/scarb-doc/tests/data/hello_world_with_features/src/hello_world-Shape.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Calculate the area of the shape
2525

2626
Fully qualified path: `hello_world::Shape::area`
2727

28-
<pre><code class="language-rust">fn area(self: T) -&gt; u32</code></pre>
28+
<pre><code class="language-rust">fn area&lt;T, T&gt;(self: T) -&gt; u32</code></pre>
2929

3030

3131
## Trait types

extensions/scarb-doc/tests/data/json_doc_hidden_impls.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"item_data": {
6060
"name": "VisibleImpl",
6161
"doc": null,
62-
"signature": "impl VisibleImpl of VisibleTrait<VisibleStruct>",
62+
"signature": "impl VisibleImpl of VisibleTrait<VisibleStruct>;",
6363
"full_path": "hello_world::VisibleImpl"
6464
}
6565
},
@@ -70,7 +70,7 @@
7070
"item_data": {
7171
"name": "SecondVisibleImpl",
7272
"doc": null,
73-
"signature": "impl SecondVisibleImpl of SecondVisibleTrait<HiddenStruct, VisibleStruct>",
73+
"signature": "impl SecondVisibleImpl of SecondVisibleTrait<<missing>, VisibleStruct>;",
7474
"full_path": "hello_world::SecondVisibleImpl"
7575
}
7676
}

extensions/scarb-doc/tests/data/json_reexports.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
"item_data": {
111111
"name": "test",
112112
"doc": null,
113-
"signature": "fn test() -> ()",
113+
"signature": "fn test()",
114114
"full_path": "sub_package::TestTrait::test"
115115
}
116116
}
@@ -140,7 +140,7 @@
140140
"item_data": {
141141
"name": "TestImpl",
142142
"doc": null,
143-
"signature": "pub impl TestImpl of TestTrait",
143+
"signature": "pub impl TestImpl of TestTrait;",
144144
"full_path": "sub_package::TestImpl"
145145
}
146146
}
@@ -150,7 +150,7 @@
150150
"item_data": {
151151
"name": "ExternalType",
152152
"doc": null,
153-
"signature": "pub extern type ExternalType",
153+
"signature": "pub extern type ExternalType;",
154154
"full_path": "sub_package::ExternalType"
155155
}
156156
}

extensions/scarb-doc/tests/markdown_target.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ impl MarkdownTargetChecker {
6565
if expected_dir_entry.file_type().is_file() {
6666
assert!(actual_dir_entry.file_type().is_file());
6767

68-
let content = fs::read_to_string(actual_dir_entry.path()).unwrap();
68+
let content = fs::read_to_string(actual_dir_entry.path())
69+
.unwrap()
70+
.replace("\r", "");
6971

7072
let expect_file =
7173
expect_file![fsx::canonicalize(expected_dir_entry.path()).unwrap()];

extensions/scarb-execute/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ pub fn execute(
171171
"Saving output to:",
172172
&display_path(&scarb_target_dir, &output_file_path),
173173
));
174-
output_value.write_zip_file(output_file_path.as_std_path())?;
174+
output_value.write_zip_file(output_file_path.as_std_path(), true)?;
175175
} else {
176176
ui.print(Status::new(
177177
"Saving output to:",

0 commit comments

Comments
 (0)