Skip to content

Commit 0358dec

Browse files
authored
Upgrade Rust to 1.81 (#1846)
This is a prerequisite for #1845 TODO: - [x] narrow down or remove the dead_code exception
1 parent c20b355 commit 0358dec

File tree

15 files changed

+57
-36
lines changed

15 files changed

+57
-36
lines changed

.github/workflows/build-cache.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
- uses: actions/checkout@v4
1616
with:
1717
submodules: recursive
18-
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
19-
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
18+
- name: Install Rust toolchain 1.81 (with clippy and rustfmt)
19+
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.81-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.81-x86_64-unknown-linux-gnu
2020
- name: Install EStarkPolygon prover dependencies
2121
run: sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm
2222
- name: Lint

.github/workflows/nightly-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ jobs:
6565
path: |
6666
~/pilcom/node_modules
6767
key: ${{ runner.os }}-pilcom-node-modules
68-
- name: Install Rust toolchain 1.77
69-
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu
68+
- name: Install Rust toolchain 1.81
69+
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu
7070
- name: Install nightly
7171
run: rustup toolchain install nightly-2024-08-01-x86_64-unknown-linux-gnu
7272
- name: Install stdlib

.github/workflows/pr-tests.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.lock') }}
4040
restore-keys: |
4141
${{ runner.os }}-cargo-pr-tests-
42-
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
43-
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
42+
- name: Install Rust toolchain 1.81 (with clippy and rustfmt)
43+
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.81-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.81-x86_64-unknown-linux-gnu
4444
- name: Install EStarkPolygon prover dependencies
4545
run: sudo apt-get install -y nlohmann-json3-dev libpqxx-dev nasm
4646
- name: Lint no default features
@@ -87,8 +87,8 @@ jobs:
8787
path: |
8888
~/pilcom/node_modules
8989
key: ${{ runner.os }}-pilcom-node-modules
90-
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
91-
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
90+
- name: Install Rust toolchain 1.81 (with clippy and rustfmt)
91+
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.81-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.81-x86_64-unknown-linux-gnu
9292
- name: Install nightly
9393
run: rustup toolchain install nightly-2024-08-01-x86_64-unknown-linux-gnu
9494
- name: Install stdlib
@@ -122,8 +122,8 @@ jobs:
122122
key: ${{ runner.os }}-cargo-pr-tests-${{ hashFiles('**/Cargo.lock') }}
123123
restore-keys: |
124124
${{ runner.os }}-cargo-pr-tests-
125-
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
126-
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
125+
- name: Install Rust toolchain 1.81 (with clippy and rustfmt)
126+
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.81-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.81-x86_64-unknown-linux-gnu
127127
- name: Run examples
128128
run: cargo run --example hello_world
129129

@@ -144,8 +144,8 @@ jobs:
144144
path: |
145145
~/pilcom/node_modules
146146
key: ${{ runner.os }}-pilcom-node-modules
147-
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
148-
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
147+
- name: Install Rust toolchain 1.81 (with clippy and rustfmt)
148+
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.81-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.81-x86_64-unknown-linux-gnu
149149
- name: Install nightly
150150
run: rustup toolchain install nightly-2024-08-01-x86_64-unknown-linux-gnu
151151
- name: Install stdlib
@@ -192,8 +192,8 @@ jobs:
192192
path: |
193193
~/pilcom/node_modules
194194
key: ${{ runner.os }}-pilcom-node-modules
195-
- name: Install Rust toolchain 1.77 (with clippy and rustfmt)
196-
run: rustup toolchain install 1.77-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.77-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.77-x86_64-unknown-linux-gnu
195+
- name: Install Rust toolchain 1.81 (with clippy and rustfmt)
196+
run: rustup toolchain install 1.81-x86_64-unknown-linux-gnu && rustup component add clippy --toolchain 1.81-x86_64-unknown-linux-gnu && rustup component add rustfmt --toolchain 1.81-x86_64-unknown-linux-gnu
197197
- name: Install test dependencies
198198
run: sudo apt-get install -y binutils-riscv64-unknown-elf lld
199199
- name: Install nightly

airgen/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,7 @@ impl<'a> ASMPILConverter<'a> {
398398
/// - they target the same instance.operation
399399
/// - they are of the same kind (permutation/lookup)
400400
/// - their flags are mutually exclusive
401+
///
401402
/// Right now we only consider links from different instructions,
402403
/// as a single instruction can be active at a time.
403404
fn process_and_merge_links(&self, defs: &[LinkDefinition]) -> Vec<Link> {

backend/src/field_filter.rs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,25 @@ macro_rules! generalize_factory {
2626
backend_options: crate::BackendOptions,
2727
) -> std::result::Result<Box<dyn crate::Backend<F>>, crate::Error> {
2828
use crate::Backend;
29-
use std::{any::TypeId, boxed::Box, result::Result::Ok};
29+
use powdr_ast::analyzed::Analyzed;
30+
use powdr_executor::constant_evaluator::VariablySizedColumn;
31+
use std::{any::TypeId, boxed::Box, result::Result::Ok, sync::Arc, string::String};
3032

3133
let result = match TypeId::of::<F>() {
3234
$(
3335
id if id == TypeId::of::<$supported_type>() => {
3436
unsafe {
3537
let result = <$restricted_factory as BackendFactory<$supported_type>>::create(
3638
&$restricted_factory,
37-
std::mem::transmute(pil), std::mem::transmute(fixed), output_dir, setup,
38-
verification_key, verification_app_key, backend_options)?;
39-
let result: Box<dyn Backend<$supported_type>> = result;
40-
std::mem::transmute(result)
39+
std::mem::transmute::<Arc<Analyzed<F>>, Arc<Analyzed<$supported_type>>>(pil),
40+
std::mem::transmute::<Arc<Vec<(String, VariablySizedColumn<F>)>>, Arc<Vec<(String, VariablySizedColumn<$supported_type>)>>>(fixed),
41+
output_dir,
42+
setup,
43+
verification_key,
44+
verification_app_key,
45+
backend_options
46+
)?;
47+
std::mem::transmute::<Box<dyn Backend<$supported_type>>, Box<dyn Backend<F>>>(result)
4148
}
4249
}
4350
)*

executor/src/witgen/identity_processor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ impl<'a, 'b, 'c, T: FieldElement, Q: QueryCallback<T>> IdentityProcessor<'a, 'b,
196196
/// - `left`: The evaluation of the left side of the lookup (symbolic for unknown values).
197197
/// - `right`: The expressions on the right side of the lookup.
198198
/// - `current_rows`: The [RowPair] needed to evaluate the right side of the lookup.
199+
///
199200
/// Returns:
200201
/// - `Ok(updates)`: The updates for the lookup.
201202
/// - `Err(e)`: If the constraint system is not satisfiable.

executor/src/witgen/machines/fixed_lookup_machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl<T: FieldElement> IndexedColumns<T> {
7777
/// `input_fixed_columns` is assumed to be sorted
7878
fn ensure_index(&mut self, fixed_data: &FixedData<T>, sorted_fixed_columns: &Application) {
7979
// we do not use the Entry API here because we want to clone `sorted_input_fixed_columns` only on index creation
80-
if self.indices.get(sorted_fixed_columns).is_some() {
80+
if self.indices.contains_key(sorted_fixed_columns) {
8181
return;
8282
}
8383

executor/src/witgen/util.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use powdr_ast::analyzed::{AlgebraicExpression as Expression, AlgebraicReference}
44
/// - a polynomial
55
/// - not part of a polynomial array
66
/// - not shifted with `'`
7+
///
78
/// and return the polynomial if so
89
pub fn try_to_simple_poly<T>(expr: &Expression<T>) -> Option<&AlgebraicReference> {
910
if let Expression::Reference(p @ AlgebraicReference { next: false, .. }) = expr {

executor/src/witgen/vm_processor.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ impl<'a, 'b, 'c, T: FieldElement, Q: QueryCallback<T>> VmProcessor<'a, 'b, 'c, T
395395
/// Arguments:
396396
/// * `identities`: Identities to process. Completed identities are removed from the list.
397397
/// * `unknown_strategy`: How to process unknown variables. Either use zero or keep it symbolic.
398+
///
398399
/// Returns:
399400
/// * `Ok(true)`: If progress was made.
400401
/// * `Ok(false)`: If no progress was made.

riscv-executor/src/poseidon_gl.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ const MDS_MATRIX: [[u64; 12]; 12] = [
3535
/// Ported from:
3636
/// - https://github.com/0xPolygonHermez/zkevm-proverjs/blob/main/pil/poseidong.pil
3737
/// - https://github.com/0xPolygonHermez/zkevm-proverjs/blob/main/src/sm/sm_poseidong.js
38+
///
3839
/// It's also equivalent to std::machines::hash::poseidon_gl::PoseidonGL from the Powdr standard library.
3940
pub fn poseidon_gl<F: FieldElement>(inputs: &[F]) -> [F; 4] {
4041
assert_eq!(inputs.len(), 12);

0 commit comments

Comments
 (0)