Skip to content
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
71ba689
chore!: enforce visibility warnings as errors
TomAFrench Mar 11, 2025
84059a1
Merge branch 'master' into tf/enforce-visibility
TomAFrench Mar 17, 2025
13eb87a
Merge branch 'master' into tf/enforce-visibility
TomAFrench Mar 24, 2025
97ecdea
Merge branch 'master' into tf/enforce-visibility
TomAFrench Apr 17, 2025
8530a29
chore: update snapshots
TomAFrench Apr 17, 2025
abc29df
.
TomAFrench Apr 17, 2025
f3d06cb
.
TomAFrench Apr 17, 2025
cf24967
.
TomAFrench Apr 17, 2025
651d998
.
TomAFrench Apr 17, 2025
273958a
.
TomAFrench Apr 17, 2025
3e5f696
.
TomAFrench Apr 17, 2025
86db477
.
TomAFrench Apr 17, 2025
72f5315
.
TomAFrench Apr 17, 2025
0f31687
.
TomAFrench Apr 17, 2025
48ffe36
.
TomAFrench Apr 17, 2025
0e939d1
.
TomAFrench Apr 17, 2025
4455ee9
.
TomAFrench Apr 18, 2025
44b4dcc
.
TomAFrench Apr 18, 2025
8ac84db
Merge branch 'master' into tf/enforce-visibility
TomAFrench Apr 18, 2025
28e4ae8
.
TomAFrench Apr 18, 2025
24f1519
.
TomAFrench Apr 18, 2025
17cdad4
.
TomAFrench Apr 18, 2025
b5843a7
.
TomAFrench Apr 18, 2025
de89af6
bigcurve status: cooked
TomAFrench Apr 18, 2025
77a8883
Merge branch 'master' into tf/enforce-visibility
Apr 29, 2025
8f8e4cd
.
Apr 29, 2025
35804a2
Merge branch 'master' into tf/enforce-visibility
TomAFrench Apr 29, 2025
82c593c
.
Apr 29, 2025
03f53b2
.
Apr 29, 2025
56d7f40
Merge branch 'master' into tf/enforce-visibility
May 12, 2025
2d231c3
.
May 12, 2025
58555e1
.
May 12, 2025
d638363
.
May 12, 2025
0aec286
Update .github/workflows/reports.yml
TomAFrench May 12, 2025
097db0d
Update EXTERNAL_NOIR_LIBRARIES.yml
TomAFrench May 12, 2025
200a2ee
Merge branch 'master' into tf/enforce-visibility
May 12, 2025
392496c
Merge branch 'master' into tf/enforce-visibility
May 12, 2025
7631f4c
.
May 12, 2025
1e4b6a6
Merge branch 'master' into tf/enforce-visibility
TomAFrench May 16, 2025
cd8fedc
Merge branch 'master' into tf/enforce-visibility
TomAFrench May 27, 2025
5da8642
.
TomAFrench May 27, 2025
3619f9c
.
TomAFrench May 27, 2025
662a754
Merge branch 'master' into tf/enforce-visibility
TomAFrench Jun 3, 2025
d424e41
Merge branch 'master' into tf/enforce-visibility
TomAFrench Jun 6, 2025
68f151e
Merge branch 'master' into tf/enforce-visibility
TomAFrench Jun 24, 2025
b50cfc1
Merge branch 'master' into tf/enforce-visibility
TomAFrench Jun 27, 2025
493d8cf
Merge branch 'master' into tf/enforce-visibility
asterite Jul 1, 2025
6c69bae
Snapshots, and fix missing nargo expand struct field visibility
asterite Jul 1, 2025
8f084d1
Use "crate" instead of "super" in nargo expand when possible
asterite Jul 1, 2025
4cf75cf
chore: Update pinned commit of aztec-packages
Jul 15, 2025
b1be6ec
Merge branch 'master' into tf/enforce-visibility
TomAFrench Jul 15, 2025
049ebab
Merge branch 'bump-aztec-packages' into tf/enforce-visibility
TomAFrench Jul 15, 2025
8236bba
Merge branch 'master' into tf/enforce-visibility
TomAFrench Jul 15, 2025
6c97362
.
TomAFrench Jul 15, 2025
e3f1aeb
chore: disable aztec-packages reports
TomAFrench Jul 15, 2025
4b00d93
.
TomAFrench Jul 15, 2025
da917f6
Merge branch 'master' into tf/enforce-visibility
TomAFrench Jul 17, 2025
07ad518
Merge branch 'master' into tf/enforce-visibility
TomAFrench Jul 17, 2025
d1a37bf
.
TomAFrench Jul 17, 2025
eeddbd1
Update tooling/nargo_cli/build.rs
TomAFrench Jul 18, 2025
1016f92
Update compiler/noirc_frontend/src/hir/resolution/import.rs
TomAFrench Jul 18, 2025
564994e
Merge branch 'master' into tf/enforce-visibility
TomAFrench Jul 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/reports.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,16 @@ jobs:
scripts/process_benchmark_data.sh
sparse-checkout-cone-mode: false

- name: Download nargo binary
uses: ./.github/actions/download-nargo

- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
path: test-repo
ref: ${{ matrix.ref }}

- name: Download nargo binary
uses: ./.github/actions/download-nargo

- name: Generate compilation report
id: compilation_report
run: |
Expand Down
62 changes: 31 additions & 31 deletions .github/workflows/test-js-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -614,36 +614,36 @@ jobs:
exit 1
fi

compile-noir-contracts:
needs: [build-nargo]
runs-on: ubuntu-22.04
timeout-minutes: 30
name: Compile `noir-contracts` zero inliner aggressiveness
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: noir-repo

- name: Checkout
uses: actions/checkout@v4
with:
repository: AztecProtocol/aztec-packages
path: test-repo

- name: Download nargo binary
uses: ./noir-repo/.github/actions/download-nargo

- name: Remove requirements on compiler version
working-directory: ./test-repo
run: |
# Github actions seems to not expand "**" in globs by default.
shopt -s globstar
sed -i '/^compiler_version/d' ./**/Nargo.toml

- name: Run nargo compile
working-directory: ./test-repo/noir-projects/noir-contracts
run: nargo compile --inliner-aggressiveness 0
# compile-noir-contracts:
# needs: [build-nargo]
# runs-on: ubuntu-22.04
# timeout-minutes: 30
# name: Compile `noir-contracts` zero inliner aggressiveness
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# path: noir-repo

# - name: Checkout
# uses: actions/checkout@v4
# with:
# repository: AztecProtocol/aztec-packages
# path: test-repo

# - name: Download nargo binary
# uses: ./noir-repo/.github/actions/download-nargo

# - name: Remove requirements on compiler version
# working-directory: ./test-repo
# run: |
# # Github actions seems to not expand "**" in globs by default.
# shopt -s globstar
# sed -i '/^compiler_version/d' ./**/Nargo.toml

# - name: Run nargo compile
# working-directory: ./test-repo/noir-projects/noir-contracts
# run: nargo compile --inliner-aggressiveness 0

upload_critical_library_report:
name: Upload critical library report
Expand Down Expand Up @@ -709,7 +709,7 @@ jobs:
- test-integration-node
- test-integration-browser
- test-examples
- compile-noir-contracts
# - compile-noir-contracts

steps:
- name: Report overall success
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/hir/resolution/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<'a> From<&'a PathResolutionError> for CustomDiagnostic {
CustomDiagnostic::simple_error(error.to_string(), String::new(), ident.location())
}
// This will be upgraded to an error in future versions
PathResolutionError::Private(ident) => CustomDiagnostic::simple_warning(
PathResolutionError::Private(ident) => CustomDiagnostic::simple_error(
error.to_string(),
format!("{ident} is private"),
ident.location(),
Expand Down
10 changes: 0 additions & 10 deletions compiler/noirc_frontend/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ fn emit_compile_test(test_path: &str, src: &str, mut expect: Expect) {
let error_to_warn_cases = [
"cast_256_to_u8_size_checks",
"enums_errors_on_unspecified_unstable_enum",
"imports_warns_on_use_of_private_exported_item",
"metaprogramming_does_not_fail_to_parse_macro_on_parser_warning",
"resolve_unused_var",
"struct_array_len",
Expand All @@ -185,17 +184,8 @@ fn emit_compile_test(test_path: &str, src: &str, mut expect: Expect) {
"unused_items_errors_on_unused_trait",
"unused_items_errors_on_unused_type_alias",
"unused_items_warns_on_unused_global",
"visibility_warns_if_calling_private_struct_method",
"warns_on_nested_unsafe",
"warns_on_unneeded_unsafe",
// TODO(https://github.com/noir-lang/noir/issues/6932): these will be hard errors
"visibility_error_when_accessing_private_struct_field",
"visibility_error_when_using_private_struct_field_in_constructor",
"visibility_error_when_using_private_struct_field_in_struct_pattern",
"visibility_errors_if_accessing_private_struct_member_inside_comptime_context",
"visibility_errors_if_accessing_private_struct_member_inside_function_generated_at_comptime",
"visibility_errors_if_trying_to_access_public_function_inside_private_module",
"visibility_errors_once_on_unused_import_that_is_not_accessible",
// TODO(https://github.com/noir-lang/noir/issues/7795): these will be hard errors
"indexing_array_with_non_u32_on_lvalue_produces_a_warning",
"indexing_array_with_non_u32_produces_a_warning",
Expand Down
25 changes: 0 additions & 25 deletions compiler/noirc_frontend/src/tests/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,31 +48,6 @@ fn use_super_in_path() {
assert_no_errors!(src);
}

#[named]
#[test]
fn warns_on_use_of_private_exported_item() {
let src = r#"
mod foo {
mod bar {
pub fn baz() {}
}

use bar::baz;

pub fn qux() {
baz();
}
}

fn main() {
foo::baz();
^^^ baz is private and not visible from the current module
~~~ baz is private
}
"#;
check_errors!(src);
}

#[named]
#[test]
fn can_use_pub_use_item() {
Expand Down
27 changes: 26 additions & 1 deletion compiler/noirc_frontend/src/tests/visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ fn errors_if_trying_to_access_public_function_inside_private_module() {

#[named]
#[test]
fn warns_if_calling_private_struct_method() {
fn errors_if_calling_private_struct_method() {
let src = r#"
mod moo {
pub struct Foo {}
Expand Down Expand Up @@ -561,3 +561,28 @@ fn errors_if_accessing_private_struct_member_inside_function_generated_at_compti
"#;
check_errors!(src);
}

#[named]
#[test]
fn errors_on_use_of_private_exported_item() {
let src = r#"
mod foo {
mod bar {
pub fn baz() {}
}

use bar::baz;

pub fn qux() {
baz();
}
}

fn main() {
foo::baz();
^^^ baz is private and not visible from the current module
~~~ baz is private
}
"#;
check_errors!(src);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: inner is private and not visible from the current module
┌─ src/main.nr:19:25
19 │ let _ = foo.inner;
│ ----- inner is private

Aborting due to 1 previous error
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

[package]
name = "noirc_frontend_tests_visibility_errors_if_calling_private_struct_method"
type = "bin"
authors = [""]

[dependencies]
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[package]
name = "noirc_frontend_tests_imports_warns_on_use_of_private_exported_item"
name = "noirc_frontend_tests_visibility_errors_on_use_of_private_exported_item"
type = "bin"
authors = [""]

Expand Down

This file was deleted.

8 changes: 7 additions & 1 deletion tooling/nargo_cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const TESTS_WITHOUT_STDOUT_CHECK: [&str; 0] = [];
/// These tests are ignored because of existing bugs in `nargo expand`.
/// As the bugs are fixed these tests should be removed from this list.
/// (some are ignored on purpose for the same reason as `IGNORED_NARGO_EXPAND_EXECUTION_TESTS`)
const IGNORED_NARGO_EXPAND_COMPILE_SUCCESS_EMPTY_TESTS: [&str; 17] = [
const IGNORED_NARGO_EXPAND_COMPILE_SUCCESS_EMPTY_TESTS: [&str; 20] = [
// bug
"associated_type_bounds",
// bug
Expand Down Expand Up @@ -180,6 +180,12 @@ const IGNORED_NARGO_EXPAND_COMPILE_SUCCESS_EMPTY_TESTS: [&str; 17] = [
"workspace_reexport_bug",
// bug
"nested_trait_associated_type_regression_8252",
// bug
"trait_call_in_global",
// bug
"comptime_traits",
// bug
"trait_multi_module_test",
];

/// These tests are ignored because of existing bugs in `nargo expand`.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading