Skip to content

Commit

Permalink
Fix #1645
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Jun 14, 2023
1 parent cbee4c0 commit ec0e0a1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions crates/nargo_cli/src/cli/compile_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use acvm::Backend;
use iter_extended::try_vecmap;
use nargo::artifacts::contract::PreprocessedContract;
use noirc_driver::{CompileOptions, CompiledProgram, Driver};
use noirc_errors::reporter;
use std::path::Path;

use clap::Args;
Expand Down Expand Up @@ -49,9 +50,11 @@ pub(crate) fn run<B: Backend>(
// If contracts is set we're compiling every function in a 'contract' rather than just 'main'.
if args.contracts {
let mut driver = setup_driver(backend, &config.program_dir)?;
let compiled_contracts = driver
.compile_contracts(&args.compile_options)
.map_err(|_| CliError::CompilationError)?;
let compiled_contracts =
driver.compile_contracts(&args.compile_options).map_err(|errors| {
reporter::report_all(driver.file_manager(), &errors, false);
CliError::CompilationError
})?;

// TODO(#1389): I wonder if it is incorrect for nargo-core to know anything about contracts.
// As can be seen here, It seems like a leaky abstraction where ContractFunctions (essentially CompiledPrograms)
Expand Down Expand Up @@ -118,5 +121,8 @@ pub(crate) fn compile_circuit<B: Backend>(
compile_options: &CompileOptions,
) -> Result<CompiledProgram, CliError<B>> {
let mut driver = setup_driver(backend, program_dir)?;
driver.compile_main(compile_options).map_err(|_| CliError::CompilationError)
driver.compile_main(compile_options).map_err(|errors| {
reporter::report_all(driver.file_manager(), &errors, false);
CliError::CompilationError
})
}
2 changes: 1 addition & 1 deletion crates/noirc_evaluator/src/ssa_refactor/opt/inlining.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl<'function> PerFunctionContext<'function> {
_ => {
self.context.failed_to_inline_a_call = true;
None
},
}
}
}

Expand Down

0 comments on commit ec0e0a1

Please sign in to comment.