Skip to content

Commit

Permalink
Merge branch 'master' into parallel-workspace-compilation
Browse files Browse the repository at this point in the history
* master:
  chore: defer reporting of errors until after compilation and optimization is finished (#2659)
  fix: fix compilation using `aztec` feature flag (#2663)
  fix: remove duplicate file extension in stack trace (#2655)
  • Loading branch information
TomAFrench committed Sep 12, 2023
2 parents fbe34c1 + b80cd40 commit 51e5127
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion compiler/noirc_errors/src/reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ fn stack_trace<'files>(
let source = files.source(call_item.file).expect("should get file source");

let (line, column) = location(source.as_ref(), call_item.span.start());
result += &format!("{}. {}.nr:{}:{}\n", i + 1, path, line, column);
result += &format!("{}. {}:{}:{}\n", i + 1, path, line, column);
}

result
Expand Down
33 changes: 18 additions & 15 deletions compiler/noirc_frontend/src/hir/def_map/aztec_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ use acvm::FieldElement;
use noirc_errors::{CustomDiagnostic, Span};

use crate::graph::CrateId;
use crate::token::SecondaryAttribute;
use crate::{
hir::Context, token::Attribute, BlockExpression, CallExpression, CastExpression, Distinctness,
Expression, ExpressionKind, ForExpression, FunctionReturnType, Ident, ImportStatement,
IndexExpression, LetStatement, Literal, MemberAccessExpression, MethodCallExpression,
NoirFunction, ParsedModule, Path, PathKind, Pattern, Statement, UnresolvedType,
UnresolvedTypeData, Visibility,
hir::Context, BlockExpression, CallExpression, CastExpression, Distinctness, Expression,
ExpressionKind, ForExpression, FunctionReturnType, Ident, ImportStatement, IndexExpression,
LetStatement, Literal, MemberAccessExpression, MethodCallExpression, NoirFunction,
ParsedModule, Path, PathKind, Pattern, Statement, UnresolvedType, UnresolvedTypeData,
Visibility,
};
use noirc_errors::FileDiagnostic;

Expand Down Expand Up @@ -188,17 +189,19 @@ fn check_for_aztec_dependency(
fn transform_module(functions: &mut [NoirFunction]) -> bool {
let mut has_annotated_functions = false;
for func in functions.iter_mut() {
if let Some(Attribute::Custom(custom_attribute)) = func.def.attribute.as_ref() {
match custom_attribute.as_str() {
"aztec(private)" => {
transform_function("Private", func);
has_annotated_functions = true;
for secondary_attribute in func.def.attributes.secondary.clone() {
if let SecondaryAttribute::Custom(custom_attribute) = secondary_attribute {
match custom_attribute.as_str() {
"aztec(private)" => {
transform_function("Private", func);
has_annotated_functions = true;
}
"aztec(public)" => {
transform_function("Public", func);
has_annotated_functions = true;
}
_ => continue,
}
"aztec(public)" => {
transform_function("Public", func);
has_annotated_functions = true;
}
_ => continue,
}
}
}
Expand Down

0 comments on commit 51e5127

Please sign in to comment.