Skip to content

Commit

Permalink
Disallow prints in all crates
Browse files Browse the repository at this point in the history
  • Loading branch information
georgwiese committed Oct 4, 2023
1 parent 12e94ac commit 39dc216
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions airgen/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Compilation from powdr machines to AIRs
#![deny(clippy::print_stdout)]

use std::collections::BTreeMap;

use ast::{
Expand Down
2 changes: 2 additions & 0 deletions analysis/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::print_stdout)]

mod block_enforcer;
mod macro_expansion;
mod vm;
Expand Down
2 changes: 2 additions & 0 deletions asm_to_pil/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::print_stdout)]

use ast::asm_analysis::AnalysisASMFile;
use number::FieldElement;
use romgen::generate_machine_rom;
Expand Down
2 changes: 2 additions & 0 deletions asm_utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Common crate for generalized assembly handling.
#![deny(clippy::print_stdout)]

use ast::{Argument, FunctionOpKind, Register};

pub mod ast;
Expand Down
2 changes: 2 additions & 0 deletions ast/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::print_stdout)]

use itertools::Itertools;
use log::log_enabled;
use number::FieldElement;
Expand Down
2 changes: 2 additions & 0 deletions backend/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::print_stdout)]

#[cfg(feature = "halo2")]
mod halo2_impl;
mod pilstark;
Expand Down
4 changes: 3 additions & 1 deletion compiler/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -337,7 +339,7 @@ pub fn inputs_to_query_callback<T: FieldElement>(inputs: Vec<T>) -> impl Fn(&str
}
"\"print_char\"" => {
assert_eq!(items.len(), 2);
print!("{}", items[1].parse::<u8>().unwrap() as char);
log::info!("{}", items[1].parse::<u8>().unwrap() as char);
Some(0.into())
}
_ => None,
Expand Down
2 changes: 2 additions & 0 deletions executor/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! Tooling used for execution of compiled programs
#![deny(clippy::print_stdout)]

pub mod constant_evaluator;
pub mod witgen;
2 changes: 2 additions & 0 deletions halo2/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::print_stdout)]

pub(crate) mod aggregation;
pub(crate) mod circuit_builder;
pub(crate) mod circuit_data;
Expand Down
2 changes: 2 additions & 0 deletions importer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::print_stdout)]

mod module_loader;
mod path_canonicalizer;
mod powdr_std;
Expand Down
2 changes: 2 additions & 0 deletions linker/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::print_stdout)]

use std::iter::once;

use analysis::utils::parse_pil_statement;
Expand Down
2 changes: 2 additions & 0 deletions number/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Numerical types used across powdr
#![deny(clippy::print_stdout)]

#[macro_use]
mod macros;
mod bn254;
Expand Down
2 changes: 2 additions & 0 deletions parser/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Parser for powdr assembly and PIL
#![deny(clippy::print_stdout)]

use ast::parsed::asm::ASMProgram;
use lalrpop_util::*;

Expand Down
2 changes: 2 additions & 0 deletions parser_util/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Utils used with different lalrpop parsers
#![deny(clippy::print_stdout)]

pub mod lines;

#[derive(Debug)]
Expand Down
2 changes: 2 additions & 0 deletions pil_analyzer/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::print_stdout)]

pub mod pil_analyzer;

use std::path::Path;
Expand Down
1 change: 1 addition & 0 deletions pilopt/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! PIL-based optimizer
#![deny(clippy::print_stdout)]

use std::collections::{BTreeMap, HashSet};

Expand Down
2 changes: 2 additions & 0 deletions riscv/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//! A RISC-V frontend for powdr
#![deny(clippy::print_stdout)]

use std::{
collections::BTreeMap,
ffi::OsStr,
Expand Down
2 changes: 2 additions & 0 deletions type_check/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![deny(clippy::print_stdout)]

use std::{collections::BTreeMap, marker::PhantomData};

use ast::{
Expand Down

0 comments on commit 39dc216

Please sign in to comment.