Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ trivial_casts = "warn"
trivial_numeric_casts = "warn"
unused_import_braces = "warn"
unused_qualifications = "warn"
unreachable_pub = "warn"
unsafe_code = "deny"
unused_must_use = "warn"

[workspace.lints.clippy]
semicolon_if_nothing_returned = "warn"
result_large_err = "allow"

[workspace.dependencies]

Expand Down
1 change: 1 addition & 0 deletions acvm-repo/acir/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
let (protoc_bin, include_dir) =
protoc_prebuilt::init("29.3").expect("failed to initialize protoc");

#[allow(unsafe_code)]
unsafe {
std::env::set_var("PROTOC", protoc_bin);
}

prost_build::compile_protos(
&[
// DTOs for a `Program`, which work with the types in `acir.cpp`

Check warning on line 14 in acvm-repo/acir/build.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (DTOs)
"./src/proto/program.proto",
// DTOs for the `WitnessStack`, which work with the types in `witness.cpp`

Check warning on line 16 in acvm-repo/acir/build.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (DTOs)
"./src/proto/acir/witness.proto",
// A pared down DTO for `Program`, so Barretenberg can ignore the Brillig part.
// This is only included to make sure it compiles.
Expand Down
1 change: 1 addition & 0 deletions acvm-repo/acir/src/circuit/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@ mod tests {
}

/// Override the maximum size of collections created by `proptest`.
#[allow(unsafe_code)]
fn run_with_max_size_range<T, F>(cases: u32, f: F)
where
T: Arbitrary,
Expand Down
2 changes: 0 additions & 2 deletions acvm-repo/acir/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
//! NOIR_CODEGEN_OVERWRITE=1 cargo test -p acir cpp_codegen
//! ```
#![cfg_attr(not(test), forbid(unsafe_code))] // `std::env::set_var` is used in tests.
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

#[doc = include_str!("../README.md")]
Expand All @@ -25,7 +23,7 @@
mod reflection {
//! Getting test failures? You've probably changed the ACIR serialization format.
//!
//! These tests generate C++ deserializers for [`ACIR bytecode`][super::circuit::Circuit]

Check warning on line 26 in acvm-repo/acir/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (deserializers)
//! and the [`WitnessMap`] structs. These get checked against the C++ files committed to the `codegen` folder
//! to see if changes have been to the serialization format. These are almost always a breaking change!
//!
Expand Down Expand Up @@ -234,21 +232,21 @@
// Using a `struct Helpers` with `static` methods, because top level functions turn up as duplicates in `wasm-ld`.
let helpers = r#"
struct Helpers {
static std::map<std::string, msgpack::object const*> make_kvmap(

Check warning on line 235 in acvm-repo/acir/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (kvmap)
msgpack::object const& o,
std::string const& name
) {
if(o.type != msgpack::type::MAP) {
std::cerr << o << std::endl;

Check warning on line 240 in acvm-repo/acir/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (endl)

Check warning on line 240 in acvm-repo/acir/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (cerr)
throw_or_abort("expected MAP for " + name);
}
std::map<std::string, msgpack::object const*> kvmap;

Check warning on line 243 in acvm-repo/acir/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (kvmap)
for (uint32_t i = 0; i < o.via.map.size; ++i) {
if (o.via.map.ptr[i].key.type != msgpack::type::STR) {
std::cerr << o << std::endl;

Check warning on line 246 in acvm-repo/acir/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (endl)

Check warning on line 246 in acvm-repo/acir/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (cerr)
throw_or_abort("expected STR for keys of " + name);
}
kvmap.emplace(

Check warning on line 249 in acvm-repo/acir/src/lib.rs

View workflow job for this annotation

GitHub Actions / Code

Unknown word (kvmap)
std::string(
o.via.map.ptr[i].key.via.str.ptr,
o.via.map.ptr[i].key.via.str.size),
Expand Down
2 changes: 0 additions & 2 deletions acvm-repo/acir_field/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![forbid(unsafe_code)]
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

mod field_element;
Expand Down
2 changes: 1 addition & 1 deletion acvm-repo/acvm/benches/arithmetic_solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fn bench_bytecode<F: AcirField>(c: &mut Criterion, benchmark_name: &str, bytecod
},
|mut vm| {
let status = vm.solve();
assert!(matches!(status, ACVMStatus::Solved))
assert!(matches!(status, ACVMStatus::Solved));
},
criterion::BatchSize::SmallInput,
);
Expand Down
2 changes: 0 additions & 2 deletions acvm-repo/acvm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![forbid(unsafe_code)]
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

pub mod compiler;
Expand Down
56 changes: 28 additions & 28 deletions acvm-repo/acvm/tests/solver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1640,7 +1640,7 @@ proptest! {
#[test]
fn poseidon2_permutation_matches_external_impl(inputs in proptest::collection::vec(field_element(), 4)) {
let (result, expected_result) = run_both_poseidon2_permutations(inputs).unwrap();
prop_assert_eq!(result, expected_result)
prop_assert_eq!(result, expected_result);
}


Expand Down Expand Up @@ -1701,15 +1701,15 @@ proptest! {
let expected_results = drop_use_constant(&zero_or_ones);
let pedantic_solving = true;
let results = bigint_solve_from_to_le_bytes(modulus.clone(), zero_or_ones, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
fn bigint_from_to_le_bytes((input, modulus) in bigint_with_modulus()) {
let expected_results: Vec<_> = drop_use_constant(&input);
let pedantic_solving = true;
let results = bigint_solve_from_to_le_bytes(modulus.clone(), input, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1724,7 +1724,7 @@ proptest! {
let expected_results: Vec<_> = drop_use_constant(&input);
let pedantic_solving = false;
let results = bigint_solve_from_to_le_bytes(modulus.clone(), input, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1739,7 +1739,7 @@ proptest! {
let expected_results: Vec<_> = drop_use_constant(&input);
let pedantic_solving = true;
let results = bigint_solve_from_to_le_bytes(modulus.clone(), input, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1753,7 +1753,7 @@ proptest! {
let expected_results: Vec<_> = drop_use_constant(&input);
let pedantic_solving = true;
let results = bigint_solve_from_to_le_bytes(modulus.clone(), input, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1769,7 +1769,7 @@ proptest! {
use_constant,
pedantic_solving,
);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1784,7 +1784,7 @@ proptest! {
use_constant,
pedantic_solving,
);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1793,7 +1793,7 @@ proptest! {
let lhs_results = bigint_solve_binary_op(bigint_add_op(), modulus.clone(), xs.clone(), ys.clone(), pedantic_solving);
let rhs_results = bigint_solve_binary_op(bigint_add_op(), modulus, ys, xs, pedantic_solving);

prop_assert_eq!(lhs_results, rhs_results)
prop_assert_eq!(lhs_results, rhs_results);
}

#[test]
Expand All @@ -1802,7 +1802,7 @@ proptest! {
let lhs_results = bigint_solve_binary_op(bigint_mul_op(), modulus.clone(), xs.clone(), ys.clone(), pedantic_solving);
let rhs_results = bigint_solve_binary_op(bigint_mul_op(), modulus, ys, xs, pedantic_solving);

prop_assert_eq!(lhs_results, rhs_results)
prop_assert_eq!(lhs_results, rhs_results);
}

#[test]
Expand All @@ -1819,7 +1819,7 @@ proptest! {
let ys_zs = use_witnesses(op_ys_zs);
let op_xs_op_ys_zs = bigint_solve_binary_op(bigint_add_op(), modulus, xs, ys_zs, pedantic_solving);

prop_assert_eq!(op_xs_ys_op_zs, op_xs_op_ys_zs)
prop_assert_eq!(op_xs_ys_op_zs, op_xs_op_ys_zs);
}

#[test]
Expand All @@ -1836,7 +1836,7 @@ proptest! {
let ys_zs = use_witnesses(op_ys_zs);
let op_xs_op_ys_zs = bigint_solve_binary_op(bigint_mul_op(), modulus, xs, ys_zs, pedantic_solving);

prop_assert_eq!(op_xs_ys_op_zs, op_xs_op_ys_zs)
prop_assert_eq!(op_xs_ys_op_zs, op_xs_op_ys_zs);
}

#[test]
Expand All @@ -1855,7 +1855,7 @@ proptest! {
let mul_xs_zs = use_witnesses(mul_xs_zs);
let add_mul_xs_ys_mul_xs_zs = bigint_solve_binary_op(bigint_add_op(), modulus, mul_xs_ys, mul_xs_zs, pedantic_solving);

prop_assert_eq!(mul_xs_add_ys_zs, add_mul_xs_ys_mul_xs_zs)
prop_assert_eq!(mul_xs_add_ys_zs, add_mul_xs_ys_mul_xs_zs);
}


Expand All @@ -1866,7 +1866,7 @@ proptest! {
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_add_op(), modulus, zero, xs, pedantic_solving);

prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1875,7 +1875,7 @@ proptest! {
let expected_results = drop_use_constant(&zero);
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_mul_op(), modulus, zero, xs, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1884,15 +1884,15 @@ proptest! {
let expected_results: Vec<_> = drop_use_constant(&xs);
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_mul_op(), modulus, one, xs, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
fn bigint_sub_self((xs, modulus) in bigint_with_modulus()) {
let expected_results = drop_use_constant(&bigint_zeroed(&xs));
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_sub_op(), modulus, xs.clone(), xs, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1901,7 +1901,7 @@ proptest! {
let expected_results: Vec<_> = drop_use_constant(&xs);
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_sub_op(), modulus, xs, zero, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1910,15 +1910,15 @@ proptest! {
let expected_results: Vec<_> = drop_use_constant(&xs);
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_sub_op(), modulus, xs, one, pedantic_solving);
prop_assert!(results != expected_results, "{:?} == {:?}", results, expected_results)
prop_assert!(results != expected_results, "{:?} == {:?}", results, expected_results);
}

#[test]
fn bigint_div_self((xs, modulus) in bigint_with_modulus()) {
let one = drop_use_constant(&bigint_to_one(&xs));
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_div_op(), modulus, xs.clone(), xs, pedantic_solving);
prop_assert_eq!(results, one)
prop_assert_eq!(results, one);
}

#[test]
Expand All @@ -1928,7 +1928,7 @@ proptest! {
let expected_results = drop_use_constant(&zero);
let pedantic_solving = false;
let results = bigint_solve_binary_op(bigint_div_op(), modulus, xs, zero, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1938,7 +1938,7 @@ proptest! {
let expected_results = drop_use_constant(&zero);
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_div_op(), modulus, xs, zero, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1947,7 +1947,7 @@ proptest! {
let expected_results = drop_use_constant(&xs);
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_div_op(), modulus, xs, one, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1956,7 +1956,7 @@ proptest! {
let expected_results = drop_use_constant(&zero);
let pedantic_solving = true;
let results = bigint_solve_binary_op(bigint_div_op(), modulus, zero, xs, pedantic_solving);
prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1967,7 +1967,7 @@ proptest! {
let add_bigint = use_witnesses(add_results);
let results = bigint_solve_binary_op(bigint_sub_op(), modulus, add_bigint, ys, pedantic_solving);

prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1978,7 +1978,7 @@ proptest! {
let add_bigint = use_witnesses(sub_results);
let results = bigint_solve_binary_op(bigint_add_op(), modulus, add_bigint, ys, pedantic_solving);

prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -1989,7 +1989,7 @@ proptest! {
let div_bigint = use_witnesses(div_results);
let results = bigint_solve_binary_op(bigint_mul_op(), modulus, div_bigint, ys, pedantic_solving);

prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}

#[test]
Expand All @@ -2000,6 +2000,6 @@ proptest! {
let mul_bigint = use_witnesses(mul_results);
let results = bigint_solve_binary_op(bigint_div_op(), modulus, mul_bigint, ys, pedantic_solving);

prop_assert_eq!(results, expected_results)
prop_assert_eq!(results, expected_results);
}
}
2 changes: 0 additions & 2 deletions acvm-repo/acvm_js/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

// See Cargo.toml for explanation.
Expand Down
2 changes: 0 additions & 2 deletions acvm-repo/blackbox_solver/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![forbid(unsafe_code)]
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

//! This crate provides the implementation of BlackBox functions of ACIR and Brillig.
Expand Down
2 changes: 0 additions & 2 deletions acvm-repo/bn254_blackbox_solver/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

use acvm_blackbox_solver::{BlackBoxFunctionSolver, BlackBoxResolutionError};
Expand Down
2 changes: 0 additions & 2 deletions acvm-repo/brillig/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![forbid(unsafe_code)]
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

//! The Brillig bytecode is distinct from regular [ACIR][acir] in that it does not generate constraints.
Expand Down
2 changes: 0 additions & 2 deletions acvm-repo/brillig_vm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#![forbid(unsafe_code)]
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]
#![cfg_attr(not(test), warn(unused_crate_dependencies, unused_extern_crates))]

//! The Brillig VM is a specialized VM which allows the [ACVM][acvm] to perform custom non-determinism.
Expand Down
2 changes: 0 additions & 2 deletions compiler/fm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![forbid(unsafe_code)]
#![warn(unused_crate_dependencies, unused_extern_crates)]
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]

mod file_map;

Expand Down
2 changes: 0 additions & 2 deletions compiler/noirc_arena/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#![forbid(unsafe_code)]
#![warn(unused_crate_dependencies, unused_extern_crates)]
#![warn(unreachable_pub)]
#![warn(clippy::semicolon_if_nothing_returned)]

use std::fmt;

Expand Down
Loading
Loading