From b1968596e0b726cd3bfcf362bcce2c30c3adf555 Mon Sep 17 00:00:00 2001 From: 0xYYY <0xYYY@pm.me> Date: Sun, 12 Feb 2023 19:41:43 +0800 Subject: [PATCH] chore: Forbid unsafe code (#824) chore: forbid unsafe code --- crates/arena/src/lib.rs | 1 + crates/fm/src/lib.rs | 1 + crates/iter-extended/src/lib.rs | 1 + crates/nargo/src/lib.rs | 1 + crates/noirc_abi/src/lib.rs | 1 + crates/noirc_driver/src/lib.rs | 1 + crates/noirc_errors/src/lib.rs | 1 + crates/noirc_evaluator/src/lib.rs | 1 + crates/noirc_frontend/src/lib.rs | 1 + crates/wasm/src/lib.rs | 1 + 10 files changed, 10 insertions(+) diff --git a/crates/arena/src/lib.rs b/crates/arena/src/lib.rs index 278178265a4..bbb04a26d84 100644 --- a/crates/arena/src/lib.rs +++ b/crates/arena/src/lib.rs @@ -1,2 +1,3 @@ +#![forbid(unsafe_code)] // For now we use a wrapper around generational-arena pub use generational_arena::{Arena, Index}; diff --git a/crates/fm/src/lib.rs b/crates/fm/src/lib.rs index ebc3d7021a8..c365f578c4a 100644 --- a/crates/fm/src/lib.rs +++ b/crates/fm/src/lib.rs @@ -1,3 +1,4 @@ +#![forbid(unsafe_code)] mod file_map; mod file_reader; diff --git a/crates/iter-extended/src/lib.rs b/crates/iter-extended/src/lib.rs index b840dc1c9b3..b5729c9a895 100644 --- a/crates/iter-extended/src/lib.rs +++ b/crates/iter-extended/src/lib.rs @@ -1,3 +1,4 @@ +#![forbid(unsafe_code)] use std::collections::BTreeMap; /// Equivalent to .into_iter().map(f).collect::>() diff --git a/crates/nargo/src/lib.rs b/crates/nargo/src/lib.rs index 526f7be373f..fd001dd3e98 100644 --- a/crates/nargo/src/lib.rs +++ b/crates/nargo/src/lib.rs @@ -1,3 +1,4 @@ +#![forbid(unsafe_code)] use noirc_frontend::graph::CrateType; use std::path::{Path, PathBuf}; diff --git a/crates/noirc_abi/src/lib.rs b/crates/noirc_abi/src/lib.rs index 821cb663912..7d8bc645102 100644 --- a/crates/noirc_abi/src/lib.rs +++ b/crates/noirc_abi/src/lib.rs @@ -1,3 +1,4 @@ +#![forbid(unsafe_code)] use std::{collections::BTreeMap, convert::TryInto, str}; use acvm::FieldElement; diff --git a/crates/noirc_driver/src/lib.rs b/crates/noirc_driver/src/lib.rs index a4f5839dd05..7f2de00b85a 100644 --- a/crates/noirc_driver/src/lib.rs +++ b/crates/noirc_driver/src/lib.rs @@ -1,3 +1,4 @@ +#![forbid(unsafe_code)] use acvm::acir::circuit::Circuit; use acvm::Language; diff --git a/crates/noirc_errors/src/lib.rs b/crates/noirc_errors/src/lib.rs index efde37d9803..99dd6554dbb 100644 --- a/crates/noirc_errors/src/lib.rs +++ b/crates/noirc_errors/src/lib.rs @@ -1,3 +1,4 @@ +#![forbid(unsafe_code)] mod position; pub mod reporter; pub use position::{Location, Position, Span, Spanned}; diff --git a/crates/noirc_evaluator/src/lib.rs b/crates/noirc_evaluator/src/lib.rs index 8d7d78219b4..a4b81469f2d 100644 --- a/crates/noirc_evaluator/src/lib.rs +++ b/crates/noirc_evaluator/src/lib.rs @@ -1,3 +1,4 @@ +#![forbid(unsafe_code)] mod errors; mod ssa; diff --git a/crates/noirc_frontend/src/lib.rs b/crates/noirc_frontend/src/lib.rs index 64b98c64eb3..2db27b62879 100644 --- a/crates/noirc_frontend/src/lib.rs +++ b/crates/noirc_frontend/src/lib.rs @@ -1,3 +1,4 @@ +#![forbid(unsafe_code)] pub mod ast; pub mod graph; pub mod lexer; diff --git a/crates/wasm/src/lib.rs b/crates/wasm/src/lib.rs index da1394f79cb..b66876ae682 100644 --- a/crates/wasm/src/lib.rs +++ b/crates/wasm/src/lib.rs @@ -1,3 +1,4 @@ +#![forbid(unsafe_code)] use acvm::acir::circuit::Circuit; use gloo_utils::format::JsValueSerdeExt; use std::path::PathBuf;