chore(elaborator): Ensure that push_location and push_type cannot be forgotten#10374
Merged
chore(elaborator): Ensure that push_location and push_type cannot be forgotten#10374
push_location and push_type cannot be forgotten#10374Conversation
Contributor
There was a problem hiding this comment.
⚠️ 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: 687015a | Previous: 27c9f67 | Ratio |
|---|---|---|---|
test_report_zkpassport_noir-ecdsa_ |
3 s |
1 s |
3 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
Contributor
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'Execution Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.
| Benchmark suite | Current: 5e9af29 | Previous: dec5ef2 | Ratio |
|---|---|---|---|
rollup-block-root-single-tx |
0.003 s |
0.002 s |
1.50 |
This comment was automatically generated by workflow using github-action-benchmark.
CC: @TomAFrench
auto-merge was automatically disabled
November 5, 2025 15:11
Pull Request is not mergeable
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Nov 6, 2025
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore(frontend): Loop control flow unit tests (noir-lang/noir#10387) chore: Release Noir(1.0.0-beta.15) (noir-lang/noir#10125) feat(doc): crate name, version, and dark mode (noir-lang/noir#10378) chore(elaborator): Add `LoopStatement` (noir-lang/noir#10377) chore(elaborator): Ensure that `push_location` and `push_type` cannot be forgotten (noir-lang/noir#10374) feat: nargo doc (noir-lang/noir#10314) chore: Add remaining doc comments to interpreter (noir-lang/noir#10368) chore: green light for bn254_blackbox_solver audit (noir-lang/noir#10371) chore: elaborator types.rs nits (noir-lang/noir#10375) fix: do not replace return for databus (noir-lang/noir#10355) END_COMMIT_OVERRIDE Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Nov 6, 2025
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore(frontend): Loop control flow unit tests (noir-lang/noir#10387) chore: Release Noir(1.0.0-beta.15) (noir-lang/noir#10125) feat(doc): crate name, version, and dark mode (noir-lang/noir#10378) chore(elaborator): Add `LoopStatement` (noir-lang/noir#10377) chore(elaborator): Ensure that `push_location` and `push_type` cannot be forgotten (noir-lang/noir#10374) feat: nargo doc (noir-lang/noir#10314) chore: Add remaining doc comments to interpreter (noir-lang/noir#10368) chore: green light for bn254_blackbox_solver audit (noir-lang/noir#10371) chore: elaborator types.rs nits (noir-lang/noir#10375) fix: do not replace return for databus (noir-lang/noir#10355) END_COMMIT_OVERRIDE
github-merge-queue bot
pushed a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Nov 6, 2025
Automated pull of nightly from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE chore(frontend): Loop control flow unit tests (noir-lang/noir#10387) chore: Release Noir(1.0.0-beta.15) (noir-lang/noir#10125) feat(doc): crate name, version, and dark mode (noir-lang/noir#10378) chore(elaborator): Add `LoopStatement` (noir-lang/noir#10377) chore(elaborator): Ensure that `push_location` and `push_type` cannot be forgotten (noir-lang/noir#10374) feat: nargo doc (noir-lang/noir#10314) chore: Add remaining doc comments to interpreter (noir-lang/noir#10368) chore: green light for bn254_blackbox_solver audit (noir-lang/noir#10371) chore: elaborator types.rs nits (noir-lang/noir#10375) fix: do not replace return for databus (noir-lang/noir#10355) END_COMMIT_OVERRIDE
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Problem*
Resolves a potential for forgetting to set the location or type of an
ExpressionorStatement. Makes it easier to review the code knowing that it cannot happen.Summary*
Adds a
PushedExprconstruct which wrap anExprIdand show the status of what has been pushed in the type as well as with flags. If not all pieces are present when the variable goes out of scope, it panics. The fact that we have to unwrap or dereference means the compiler tells us when we need to push the type information.The new type also makes it possible to demand that location has been pushed, which is used in at least one method that produces the
Type: if we ask forPushedExpr<HasLocation>then the compiler ensures that there shouldn't be a panic when querying the interner for the location of the ID.The only place I found the type was missing was in
make_error.Additional Context
Originally I added support for pushing the type first, and then the location, or vice versa, but in practice location is always immediately available, so I changed all call sites to use either
push_expr_full, orintern_exprfollowed by a newintern_expr_type. Since we never do it the other way, I removed the option to start withpush_type, thinking that since all of these arepub, should we add another necessary pushable thing later, I don't want to support 3*2 paths to completion, if it can be restricted to go in a linear fashion.For statements it turns out that the location was always available, and so I just used a new
push_stmt_fulleverywhere, but still added support for pushing separately. Originally aPushedStmtwas added, but it was removed as it wasn't used, along withpush_stmt.Documentation*
Check one:
PR Checklist*
cargo fmton default settings.