Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 2606-cmd-curr-package
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed Dec 10, 2024
2 parents a378766 + 52bcb0f commit d2345d8
Show file tree
Hide file tree
Showing 12 changed files with 43 additions and 270 deletions.
24 changes: 15 additions & 9 deletions compiler/noirc_driver/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use clap::Args;
use fm::{FileId, FileManager};
use iter_extended::vecmap;
use noirc_abi::{AbiParameter, AbiType, AbiValue};
use noirc_errors::{CustomDiagnostic, FileDiagnostic};
use noirc_errors::{CustomDiagnostic, DiagnosticKind, FileDiagnostic};
use noirc_evaluator::create_program;
use noirc_evaluator::errors::RuntimeError;
use noirc_evaluator::ssa::{SsaLogging, SsaProgramArtifact};
Expand Down Expand Up @@ -301,23 +301,29 @@ pub fn check_crate(
crate_id: CrateId,
options: &CompileOptions,
) -> CompilationResult<()> {
let mut errors = vec![];
let error_on_unused_imports = true;
let diagnostics = CrateDefMap::collect_defs(
crate_id,
context,
options.debug_comptime_in_file.as_deref(),
error_on_unused_imports,
);
errors.extend(diagnostics.into_iter().map(|(error, file_id)| {
let diagnostic = CustomDiagnostic::from(&error);
diagnostic.in_file(file_id)
}));
let warnings_and_errors: Vec<FileDiagnostic> = diagnostics
.into_iter()
.map(|(error, file_id)| {
let diagnostic = CustomDiagnostic::from(&error);
diagnostic.in_file(file_id)
})
.filter(|diagnostic| {
// We filter out any warnings if they're going to be ignored later on to free up memory.
!options.silence_warnings || diagnostic.diagnostic.kind != DiagnosticKind::Warning
})
.collect();

if has_errors(&errors, options.deny_warnings) {
Err(errors)
if has_errors(&warnings_and_errors, options.deny_warnings) {
Err(warnings_and_errors)
} else {
Ok(((), errors))
Ok(((), warnings_and_errors))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ fn call_foreign(
"sha256_compression" => sha256_compression(interner, args, location),
_ => {
let explanation = match name {
"schnorr_verify" => "Schnorr verification will be removed.".into(),
"and" | "xor" => "It should be turned into a binary operation.".into(),
"recursive_aggregation" => "A proof cannot be verified at comptime.".into(),
_ => {
Expand Down
1 change: 0 additions & 1 deletion docs/docs/noir/standard_library/black_box_fns.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Here is a list of the current black box functions:

- [AES128](./cryptographic_primitives/ciphers.mdx#aes128)
- [SHA256](./cryptographic_primitives/hashes.mdx#sha256)
- [Schnorr signature verification](./cryptographic_primitives/schnorr.mdx)
- [Blake2s](./cryptographic_primitives/hashes.mdx#blake2s)
- [Blake3](./cryptographic_primitives/hashes.mdx#blake3)
- [Pedersen Hash](./cryptographic_primitives/hashes.mdx#pedersen_hash)
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion noir_stdlib/src/lib.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ pub mod aes128;
pub mod array;
pub mod slice;
pub mod merkle;
pub mod schnorr;
pub mod ecdsa_secp256k1;
pub mod ecdsa_secp256r1;
pub mod embedded_curve_ops;
Expand Down
95 changes: 0 additions & 95 deletions noir_stdlib/src/schnorr.nr

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions test_programs/execution_success/schnorr/Nargo.toml

This file was deleted.

70 changes: 0 additions & 70 deletions test_programs/execution_success/schnorr/Prover.toml

This file was deleted.

24 changes: 0 additions & 24 deletions test_programs/execution_success/schnorr/src/main.nr

This file was deleted.

28 changes: 28 additions & 0 deletions tooling/nargo_cli/src/cli/test_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,3 +295,31 @@ fn display_test_report(

Ok(())
}

#[cfg(test)]
mod tests {
use std::io::Write;
use std::{thread, time::Duration};
use termcolor::{ColorChoice, StandardStream};

#[test]
fn test_stderr_lock() {
for i in 0..4 {
thread::spawn(move || {
let mut writer = StandardStream::stderr(ColorChoice::Always);
//let mut writer = writer.lock();

let mut show = |msg| {
thread::sleep(Duration::from_millis(10));
//println!("{i} {msg}");
writeln!(writer, "{i} {msg}").unwrap();
};

show("a");
show("b");
show("c");
});
}
thread::sleep(Duration::from_millis(100));
}
}

0 comments on commit d2345d8

Please sign in to comment.