Skip to content

fix(experimental): Replace most remaining match panics with errors#7536

Merged
jfecher merged 6 commits intomasterfrom
jf/match-errors
Feb 26, 2025
Merged

fix(experimental): Replace most remaining match panics with errors#7536
jfecher merged 6 commits intomasterfrom
jf/match-errors

Conversation

@jfecher
Copy link
Contributor

@jfecher jfecher commented Feb 26, 2025

Description

Problem*

Resolves

Summary*

Replaces most remaining panic/println cases in the match compiler with friendly user errors.

The only two remaining errors are what I consider to be the meatier ones: redundant cases & unhandled cases since these require more analysis of the match tree itself. The later also typically requires constructing an example of a value that wouldn't be matched as part of the error message.

Additional Context

I've moved the frontend tests which deal with enums & matches to a new tests/enums.rs file since the frontend tests file is quite large. I'll add a comment noting where the new tests in this file are - the old ones are unchanged.

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.

@jfecher jfecher requested a review from a team February 26, 2025 17:23
Copy link
Collaborator

@asterite asterite left a comment

Choose a reason for hiding this comment

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

Looks great!

@jfecher jfecher added this pull request to the merge queue Feb 26, 2025
Merged via the queue into master with commit d118e17 Feb 26, 2025
102 checks passed
@jfecher jfecher deleted the jf/match-errors branch February 26, 2025 19:29
AztecBot pushed a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 26, 2025
chore: revert bump of base64ct to `v1.6.0` after `v1.7.0` yanked (noir-lang/noir#7541)
feat(performance): Avoid extra Brillig array offsetting for constant indices  (noir-lang/noir#7522)
feat: test error spans and messages (noir-lang/noir#7526)
chore: bump wasm-bindgen (noir-lang/noir#7535)
chore: parallelize `test_transform_program_is_idempotent` (noir-lang/noir#7539)
chore(cli): Use `noir_artifact_cli::fs` to read artifacts (noir-lang/noir#7391)
fix(experimental): Replace most remaining match panics with errors (noir-lang/noir#7536)
chore: bump external pinned commits (noir-lang/noir#7537)
TomAFrench added a commit to AztecProtocol/aztec-packages that referenced this pull request Mar 4, 2025
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore!: bump rust edition to 2024
(noir-lang/noir#7533)
chore: revert bump of base64ct to `v1.6.0` after `v1.7.0` yanked
(noir-lang/noir#7541)
feat(performance): Avoid extra Brillig array offsetting for constant
indices (noir-lang/noir#7522)
feat: test error spans and messages
(noir-lang/noir#7526)
chore: bump wasm-bindgen (noir-lang/noir#7535)
chore: parallelize `test_transform_program_is_idempotent`
(noir-lang/noir#7539)
chore(cli): Use `noir_artifact_cli::fs` to read artifacts
(noir-lang/noir#7391)
fix(experimental): Replace most remaining match panics with errors
(noir-lang/noir#7536)
chore: bump external pinned commits
(noir-lang/noir#7537)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <tom@tomfren.ch>
Co-authored-by: guipublic <47281315+guipublic@users.noreply.github.com>
Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Co-authored-by: guipublic <guipublic@gmail.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.

2 participants