From 1ce585d724063f7f0cf0e791f51c2c79d6221fff Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 6 Nov 2023 17:00:59 +0100 Subject: [PATCH] Explicitly allow printing to stdout. --- asm_utils/src/reachability.rs | 1 + compiler/src/lib.rs | 1 + halo2/src/mock_prover.rs | 1 + pil_analyzer/src/pil_analyzer.rs | 1 + powdr_cli/src/main.rs | 2 ++ riscv/build.rs | 1 + riscv/src/lib.rs | 2 ++ 7 files changed, 9 insertions(+) diff --git a/asm_utils/src/reachability.rs b/asm_utils/src/reachability.rs index b517883241..93bbd7326b 100644 --- a/asm_utils/src/reachability.rs +++ b/asm_utils/src/reachability.rs @@ -56,6 +56,7 @@ pub fn filter_reachable_from( .collect(); } +#[allow(clippy::print_stderr)] pub fn find_reachable_labels<'a, R: Register, F: FunctionOpKind, A: Architecture>( label: &'a str, statements: &'a [Statement], diff --git a/compiler/src/lib.rs b/compiler/src/lib.rs index 47b2294f23..6347561ba4 100644 --- a/compiler/src/lib.rs +++ b/compiler/src/lib.rs @@ -136,6 +136,7 @@ pub fn compile_asm( /// fixed and witness columns. /// /// Returns the relative pil file name and the compilation result if any compilation was done. +#[allow(clippy::print_stderr)] pub fn compile_asm_string( file_name: &str, contents: &str, diff --git a/halo2/src/mock_prover.rs b/halo2/src/mock_prover.rs index 24fefaa5d4..ead1f4e510 100644 --- a/halo2/src/mock_prover.rs +++ b/halo2/src/mock_prover.rs @@ -42,6 +42,7 @@ mod test { use super::*; + #[allow(clippy::print_stdout)] fn mock_prove_asm(file_name: &str, inputs: &[Bn254Field]) { // read and compile PIL. diff --git a/pil_analyzer/src/pil_analyzer.rs b/pil_analyzer/src/pil_analyzer.rs index 686a8d6774..0f2a647c3f 100644 --- a/pil_analyzer/src/pil_analyzer.rs +++ b/pil_analyzer/src/pil_analyzer.rs @@ -80,6 +80,7 @@ impl PILAnalyzer { self.process_file_contents(&path, &contents); } + #[allow(clippy::print_stderr)] pub fn process_file_contents(&mut self, path: &Path, contents: &str) { let old_current_file = std::mem::take(&mut self.current_file); let old_line_starts = std::mem::take(&mut self.line_starts); diff --git a/powdr_cli/src/main.rs b/powdr_cli/src/main.rs index b75bad3e5d..7ac902a93c 100644 --- a/powdr_cli/src/main.rs +++ b/powdr_cli/src/main.rs @@ -289,6 +289,7 @@ fn main() -> Result<(), io::Error> { } } +#[allow(clippy::print_stderr)] fn run_command(command: Commands) { match command { Commands::Rust { @@ -598,6 +599,7 @@ fn read_and_prove( ); } +#[allow(clippy::print_stdout)] fn optimize_and_output(file: &str) { println!( "{}", diff --git a/riscv/build.rs b/riscv/build.rs index c5977c1e9a..ce8aad4773 100644 --- a/riscv/build.rs +++ b/riscv/build.rs @@ -18,6 +18,7 @@ fn build_lalrpop() { .unwrap(); } +#[allow(clippy::print_stdout)] fn build_instruction_tests() { let out_dir = env::var("OUT_DIR").unwrap(); let destination = Path::new(&out_dir).join("instruction_tests.rs"); diff --git a/riscv/src/lib.rs b/riscv/src/lib.rs index 0a6dea58d2..9514c99a75 100644 --- a/riscv/src/lib.rs +++ b/riscv/src/lib.rs @@ -26,6 +26,7 @@ type Expression = asm_utils::ast::Expression; /// Compiles a rust file all the way down to PIL and generates /// fixed and witness columns. +#[allow(clippy::print_stderr)] pub fn compile_rust( file_name: &str, output_dir: &Path, @@ -68,6 +69,7 @@ pub fn compile_rust( ) } +#[allow(clippy::print_stderr)] pub fn compile_riscv_asm_bundle( original_file_name: &str, riscv_asm_files: BTreeMap,