You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should add a panic method to stdlib as a way to halt computation and return a value of any type, since we know it can't be used. assert(false) alone is insufficient since it returns a unit type.
# Description
## Problem
Resolves#5849
## Summary
Adds a `panic` method exactly as proposed in #5849 , and uses it in a
couple of places where `panic` would have been useful to have.
## Additional Context
Is it okay in `std::panic::panic`? Where should we document this? (maybe
in a new `panic.md` file, or somewhere else?)
## Documentation\*
Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[For Experimental Features]** Documentation to be submitted in a
separate PR.
# PR Checklist
- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
---------
Co-authored-by: jfecher <jake@aztecprotocol.com>
Problem
We should add a
panic
method to stdlib as a way to halt computation and return a value of any type, since we know it can't be used.assert(false)
alone is insufficient since it returns a unit type.Happy Case
We add the function:
The prelude would be a good place for it since users will be used to
panic!()
being available in rust without import.Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: