-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Move templated code for assert_message into the stdlib (#4475)
# Description ## Problem\* We currently have a noirc_macros crate which checks for the stdlib and inserts two functions into the stdlib. The motivation being that we did not want users to be able to see these functions. Introducing a new crate for this reason, does not seem to be worth it since its ~7 lines of noir code. ## Solution\* This PR removes the noirc_macros crate and copies the noir code that was being pasted into the stdlib, directly into the stdlib ## Additional Context ## Documentation\* Check one: - [ ] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [ ] I have tested the changes locally. - [ ] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: Tom French <[email protected]> Co-authored-by: Tom French <[email protected]>
- Loading branch information
1 parent
18e1fe2
commit ea9a834
Showing
9 changed files
with
22 additions
and
106 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// This file contains functions which should only be used in calls injected by the Noir compiler. | ||
// These functions should not be called manually in user code. | ||
// | ||
// Changes to this file will not be considered breaking. | ||
|
||
#[oracle(assert_message)] | ||
unconstrained fn assert_message_oracle<T>(_input: T) {} | ||
unconstrained pub fn resolve_assert_message<T>(input: T, condition: bool) { | ||
if !condition { | ||
assert_message_oracle(input); | ||
} | ||
} |
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.