Skip to content

chore: test that associated function and constant with the same name collide#9112

Merged
TomAFrench merged 2 commits intomasterfrom
ab/test-associated-items-clash
Jul 3, 2025
Merged

chore: test that associated function and constant with the same name collide#9112
TomAFrench merged 2 commits intomasterfrom
ab/test-associated-items-clash

Conversation

@asterite
Copy link
Collaborator

@asterite asterite commented Jul 3, 2025

Description

Problem

Resolves #9111

Summary

Also always uses "trait associated item" in error messages.

I checked Rust and their error message is:

error[E0428]: the name `N` is defined multiple times
 --> src/main.rs:3:5
  |
2 |     fn N() {}
  |     ------ previous definition of the value `N` here
3 |     fn N() {}
  |     ^^^^^^ `N` redefined here
  |
  = note: `N` must be defined only once in the value namespace of this trait

so they also try to avoid saying "function" or "constant".

Additional Context

Documentation

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: f9eb262 Previous: 6145aaa Ratio
test_report_zkpassport_noir_rsa_ 1 s 0 s +∞

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@asterite asterite requested a review from a team July 3, 2025 17:51
Copy link
Member

@TomAFrench TomAFrench left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TomAFrench TomAFrench added this pull request to the merge queue Jul 3, 2025
Merged via the queue into master with commit 5b50524 Jul 3, 2025
118 checks passed
@TomAFrench TomAFrench deleted the ab/test-associated-items-clash branch July 3, 2025 19:45
github-merge-queue bot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Jul 4, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: remove redundant associated constant lookup
(noir-lang/noir#9114)
chore: test that associated function and constant with the same name
collide (noir-lang/noir#9112)
feat: Allow TraitAsType syntax to refer to associated constants in
expressions (noir-lang/noir#9041)
chore: clippy (noir-lang/noir#9101)
chore(fuzz): Recursively generate lvalue for multi dimensional arrays
and nested tuples (noir-lang/noir#9086)
fix!: remove `hash_to_field` from stdlib
(noir-lang/noir#9098)
chore(docs): Brillig gen (noir-lang/noir#9085)
chore(fuzz): Test AST print-and-parse roundtrip
(noir-lang/noir#9083)
fix(ssa): Do not fail for static assertions in a map over empty dynamic
slices (noir-lang/noir#9060)
chore: merge `RangeCheckFailed` and `RangeCheckFailedWithMessage`
(noir-lang/noir#9093)
chore(fuzz): Capture printed output in `comptime_vs_brillig_direct`
(noir-lang/noir#9090)
chore(debug): Add trait constraint to string helper
(noir-lang/noir#9082)
chore: bump some deps (noir-lang/noir#9076)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
danielntmd pushed a commit to danielntmd/aztec-packages that referenced this pull request Jul 16, 2025
Automated pull of nightly from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: remove redundant associated constant lookup
(noir-lang/noir#9114)
chore: test that associated function and constant with the same name
collide (noir-lang/noir#9112)
feat: Allow TraitAsType syntax to refer to associated constants in
expressions (noir-lang/noir#9041)
chore: clippy (noir-lang/noir#9101)
chore(fuzz): Recursively generate lvalue for multi dimensional arrays
and nested tuples (noir-lang/noir#9086)
fix!: remove `hash_to_field` from stdlib
(noir-lang/noir#9098)
chore(docs): Brillig gen (noir-lang/noir#9085)
chore(fuzz): Test AST print-and-parse roundtrip
(noir-lang/noir#9083)
fix(ssa): Do not fail for static assertions in a map over empty dynamic
slices (noir-lang/noir#9060)
chore: merge `RangeCheckFailed` and `RangeCheckFailedWithMessage`
(noir-lang/noir#9093)
chore(fuzz): Capture printed output in `comptime_vs_brillig_direct`
(noir-lang/noir#9090)
chore(debug): Add trait constraint to string helper
(noir-lang/noir#9082)
chore: bump some deps (noir-lang/noir#9076)
END_COMMIT_OVERRIDE

---------

Co-authored-by: AztecBot <tech@aztecprotocol.com>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test that trait associated constants and functions collide by name

2 participants