From 286051c2d61d3e7d14ca4670ab009b90a9d632c7 Mon Sep 17 00:00:00 2001 From: Georg Wiese Date: Wed, 4 Oct 2023 13:37:26 +0000 Subject: [PATCH] Disallow prints in all crates --- airgen/src/lib.rs | 2 ++ analysis/src/lib.rs | 2 ++ asm_to_pil/src/lib.rs | 2 ++ asm_utils/src/lib.rs | 2 ++ ast/src/lib.rs | 2 ++ backend/src/lib.rs | 2 ++ compiler/src/lib.rs | 4 +++- executor/src/lib.rs | 2 ++ halo2/src/lib.rs | 2 ++ importer/src/lib.rs | 2 ++ linker/src/lib.rs | 2 ++ number/src/lib.rs | 2 ++ parser/src/lib.rs | 2 ++ parser_util/src/lib.rs | 2 ++ pil_analyzer/src/lib.rs | 2 ++ pilopt/src/lib.rs | 1 + riscv/src/lib.rs | 2 ++ type_check/src/lib.rs | 2 ++ 18 files changed, 36 insertions(+), 1 deletion(-) diff --git a/airgen/src/lib.rs b/airgen/src/lib.rs index 202ff7665c..19bd7b65f7 100644 --- a/airgen/src/lib.rs +++ b/airgen/src/lib.rs @@ -1,5 +1,7 @@ //! Compilation from powdr machines to AIRs +#![deny(clippy::print_stdout)] + use std::collections::BTreeMap; use ast::{ diff --git a/analysis/src/lib.rs b/analysis/src/lib.rs index 801108a193..4494f3354b 100644 --- a/analysis/src/lib.rs +++ b/analysis/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(clippy::print_stdout)] + mod block_enforcer; mod macro_expansion; mod vm; diff --git a/asm_to_pil/src/lib.rs b/asm_to_pil/src/lib.rs index b3d76238aa..e173ec3230 100644 --- a/asm_to_pil/src/lib.rs +++ b/asm_to_pil/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(clippy::print_stdout)] + use ast::asm_analysis::AnalysisASMFile; use number::FieldElement; use romgen::generate_machine_rom; diff --git a/asm_utils/src/lib.rs b/asm_utils/src/lib.rs index 62b6b6c09a..3685c7d43b 100644 --- a/asm_utils/src/lib.rs +++ b/asm_utils/src/lib.rs @@ -1,5 +1,7 @@ //! Common crate for generalized assembly handling. +#![deny(clippy::print_stdout)] + use ast::{Argument, FunctionOpKind, Register}; pub mod ast; diff --git a/ast/src/lib.rs b/ast/src/lib.rs index ebe612a4e6..064c7222b1 100644 --- a/ast/src/lib.rs +++ b/ast/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(clippy::print_stdout)] + use itertools::Itertools; use log::log_enabled; use number::FieldElement; diff --git a/backend/src/lib.rs b/backend/src/lib.rs index 65b861802b..deb22929db 100644 --- a/backend/src/lib.rs +++ b/backend/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(clippy::print_stdout)] + #[cfg(feature = "halo2")] mod halo2_impl; mod pilstark; diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 81131a5d6d..1b678d829c 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -1,5 +1,7 @@ //! The main powdr lib, used to compile from assembly to PIL +#![deny(clippy::print_stdout)] + use std::ffi::OsStr; use std::fs; use std::io::BufWriter; @@ -337,7 +339,7 @@ pub fn inputs_to_query_callback(inputs: Vec) -> impl Fn(&str } "\"print_char\"" => { assert_eq!(items.len(), 2); - print!("{}", items[1].parse::().unwrap() as char); + log::info!("{}", items[1].parse::().unwrap() as char); Some(0.into()) } _ => None, diff --git a/executor/src/lib.rs b/executor/src/lib.rs index e9e51f328b..68b5e29734 100644 --- a/executor/src/lib.rs +++ b/executor/src/lib.rs @@ -1,4 +1,6 @@ //! Tooling used for execution of compiled programs +#![deny(clippy::print_stdout)] + pub mod constant_evaluator; pub mod witgen; diff --git a/halo2/src/lib.rs b/halo2/src/lib.rs index 4236ed6143..731b8c75f3 100644 --- a/halo2/src/lib.rs +++ b/halo2/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(clippy::print_stdout)] + pub(crate) mod aggregation; pub(crate) mod circuit_builder; pub(crate) mod circuit_data; diff --git a/importer/src/lib.rs b/importer/src/lib.rs index 3b43c647d6..24f2ee2140 100644 --- a/importer/src/lib.rs +++ b/importer/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(clippy::print_stdout)] + mod module_loader; mod path_canonicalizer; mod powdr_std; diff --git a/linker/src/lib.rs b/linker/src/lib.rs index 29fbb33420..0877230974 100644 --- a/linker/src/lib.rs +++ b/linker/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(clippy::print_stdout)] + use std::iter::once; use analysis::utils::parse_pil_statement; diff --git a/number/src/lib.rs b/number/src/lib.rs index 413d30808f..060552bd8e 100644 --- a/number/src/lib.rs +++ b/number/src/lib.rs @@ -1,5 +1,7 @@ //! Numerical types used across powdr +#![deny(clippy::print_stdout)] + #[macro_use] mod macros; mod bn254; diff --git a/parser/src/lib.rs b/parser/src/lib.rs index a5dcf11a86..723a19ce59 100644 --- a/parser/src/lib.rs +++ b/parser/src/lib.rs @@ -1,5 +1,7 @@ //! Parser for powdr assembly and PIL +#![deny(clippy::print_stdout)] + use ast::parsed::asm::ASMProgram; use lalrpop_util::*; diff --git a/parser_util/src/lib.rs b/parser_util/src/lib.rs index f8a9eec9b7..030366e0a0 100644 --- a/parser_util/src/lib.rs +++ b/parser_util/src/lib.rs @@ -1,5 +1,7 @@ //! Utils used with different lalrpop parsers +#![deny(clippy::print_stdout)] + pub mod lines; #[derive(Debug)] diff --git a/pil_analyzer/src/lib.rs b/pil_analyzer/src/lib.rs index 372fae4827..92314ef71a 100644 --- a/pil_analyzer/src/lib.rs +++ b/pil_analyzer/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(clippy::print_stdout)] + pub mod pil_analyzer; use std::path::Path; diff --git a/pilopt/src/lib.rs b/pilopt/src/lib.rs index 494c166503..65138db22d 100644 --- a/pilopt/src/lib.rs +++ b/pilopt/src/lib.rs @@ -1,4 +1,5 @@ //! PIL-based optimizer +#![deny(clippy::print_stdout)] use std::collections::{BTreeMap, HashSet}; diff --git a/riscv/src/lib.rs b/riscv/src/lib.rs index 20696f1163..03dce57df9 100644 --- a/riscv/src/lib.rs +++ b/riscv/src/lib.rs @@ -1,4 +1,6 @@ //! A RISC-V frontend for powdr +#![deny(clippy::print_stdout)] + use std::{ collections::BTreeMap, ffi::OsStr, diff --git a/type_check/src/lib.rs b/type_check/src/lib.rs index 743d08079b..81e810e3e8 100644 --- a/type_check/src/lib.rs +++ b/type_check/src/lib.rs @@ -1,3 +1,5 @@ +#![deny(clippy::print_stdout)] + use std::{collections::BTreeMap, marker::PhantomData}; use ast::{