Releases: noir-lang/noir
Releases · noir-lang/noir
v0.34.0
0.34.0 (2024-09-13)
⚠ BREAKING CHANGES
- Add Not instruction in brillig (AztecProtocol/aztec-packages#8488)
- avm: variants for SET opcode (AztecProtocol/aztec-packages#8441)
- avm/brillig: take addresses in calldatacopy (AztecProtocol/aztec-packages#8388)
- Do not encode assertion strings in the programs (AztecProtocol/aztec-packages#8315)
- return arrays instead of slices from
to_be_radix
functions (#5851) - Check unused generics are bound (#5840)
Features
- (bb) 128-bit challenges (AztecProtocol/aztec-packages#8406) (3c3ed1e)
- (LSP) suggest names that match any part of the current prefix (#5752) (cb0d490)
Module::add_item
(#5947) (af50a7b)- Add
Expr::as_any_integer
andExpr::as_member_access
(#5742) (6266755) - Add
Expr::as_array
,Expr::as_repeated_element_array
and same for slice (#5750) (f44e0b3) - Add
Expr::as_assert_eq
(#5880) (88f7858) - Add
Expr::as_assert
(#5857) (4e4ad26) - Add
Expr::as_binary_op
(#5734) (73a9f51) - Add
Expr::as_block
andExpr::has_semicolon
(#5784) (19ffa20) - Add
Expr::as_bool
(#5729) (ca75cc2) - Add
Expr::as_cast
andUnresolvedType::is_field
(#5801) (c9aa50d) - Add
Expr::as_let
(#5964) (65da598) - Add
Expr::as_unary
(#5731) (ae33811) - Add
Expr::resolve
andTypedExpr::as_function_definition
(#5859) (bceee55) - Add
Expr
methods:as_tuple
,as_parenthesized
,as_index
,as_if
(#5726) (f57a7b2) - Add
Expr
methods: as_comptime, as_unsafe, is_break, is_continue (#5799) (619fa5c) - Add
fmtstr::contents
(#5928) (f18e9ca) - Add
FunctionDef::body
(#5825) (39b30ba) - Add
FunctionDef::has_named_attribute
(#5870) (a950195) - Add
FunctionDef::set_return_visibility
(#5941) (8beda6b) - Add
FunctionDefinition::add_attribute
(#5944) (c7479c4) - Add
FunctionDefinition::module
andStructDefinition::module
(#5956) (f19344c) - Add
FunctionDefinition
methodsis_unconstrained
andset_unconstrained
(#5962) (b9a072d) - Add
Module::structs
(#6017) (fc5bb02) - Add
Quoted::as_expr
andExpr::as_function_call
(#5708) (3f79607) - Add
Quoted::tokens
(#5942) (a297ec6) - Add
std::meta::typ::fresh_type_variable
(#5948) (3dab4dd) - Add
StructDefinition::add_attribute
andhas_named_attribute
(#5945) (344dd5e) - Add
StructDefinition::add_generic
(#5961) (6004067) - Add
StructDefinition::name
(#5960) (102ebe3) - Add
StructDefinition::set_fields
(#5931) (9d2629d) - Add
TraitImpl::trait_generic_args
andTraitImpl::methods
(#5722) (8c7e493) - Add
Type::as_string
(#5871) (e29d4b3) - Add
Type::get_trait_impl
(#5716) (eb33d1c) - Add
Type::implements
(#5701) (2166c94) - Add
TypedExpr::get_type
(#5992) (31f50c4) - Add
UnresolvedType::is_field
andExpr::as_assign
(#5804) (c45df4e) - Add
unsafe
blocks for calling unconstrained code from constrained functions (#4429) (79593b4) - Add a
panic
method to the stdlib (#5966) (b86c2bc) - Add array_to_str_lossy (#5613) (af5acf4)
- Add assertions for ACVM
FunctionInput
bit_size
(#5864) (8712f4c) - Add Expr::as_method_call (#5822) (806af24)
- Add mutating FunctionDefinition functions (#5685) (2882eae)
- Add Not instruction in brillig (AztecProtocol/aztec-packages#8488) (95e19ab)
- Add recursive aggregation object to proving/verification keys (AztecProtocol/aztec-packages#6770) (4ea25db)
- Add reusable procedures to brillig generation (AztecProtocol/aztec-packages#7981) (5c4f19f)
- Add some
Module
comptime functions (#5684) (eefd69b) - Added indirect const instruction (https://github.com/AztecProtocol/aztec-packages/pull...
nightly-2024-09-16: feat: add `Expr::as_for` and `Expr::as_for_range` (#6039)
Pre-release
# Description ## Problem Part of #5668 ## Summary ## Additional Context ## Documentation Check one: - [ ] No documentation needed. - [x] 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.
nightly-2024-09-15: feat: add `Expr::as_for` and `Expr::as_for_range` (#6039)
Pre-release
# Description ## Problem Part of #5668 ## Summary ## Additional Context ## Documentation Check one: - [ ] No documentation needed. - [x] 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.
nightly-2024-09-14: feat: add `Expr::as_for` and `Expr::as_for_range` (#6039)
Pre-release
# Description ## Problem Part of #5668 ## Summary ## Additional Context ## Documentation Check one: - [ ] No documentation needed. - [x] 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.
nightly-2024-09-13: feat: implement LSP code action "Implement missing members" (#6020)
Pre-release
# Description ## Problem Part of #1579 ## Summary Adds a code action to add missing trait impl methods and types. Default methods are not includeded. Here it's working for `Add`: ![lsp-implement-missing-members-add](https://github.com/user-attachments/assets/0b3b4afc-c1bf-4c1e-9c9e-44186c7bb01b) Here for `BigField`: ![lsp-implement-missing-members-big-field](https://github.com/user-attachments/assets/22ec63b2-9fff-4824-b9c5-2aad85cc2fce) Here for a complex type in Aztec-Packages: ![lsp-implement-missing-members-aztec](https://github.com/user-attachments/assets/de822bcc-1397-456a-8175-58613ffa1f0e) ## Additional Context I found this code action in Rust very useful! It saves a lot of time, plus there's no need to copy-paste :-) ## Documentation Check one: - [x] 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.
nightly-2024-09-12: chore: single install script for cargo-binstall (#5998)
# Description ## Problem\* Resolves <!-- Link to GitHub Issue --> ## Summary\* This PR just avoids us having multiple ways to install `cargo-binstall` so everything goes through `cargo-binstall-install.sh` ## Additional Context ## Documentation\* Check one: - [x] 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.
nightly-2024-09-11: feat: LSP completion function detail (#5993)
# Description ## Problem Just a tiny thing: when functions are suggested, Rust Analyzer shows the full function signature above the documentation (this is a completion item's `detail` property). It's useful because in the list the signature is usually trimmed. ## Summary Before: ![image](https://github.com/user-attachments/assets/173acca4-74fe-40ff-9c8c-6552296c05e4) After: ![image](https://github.com/user-attachments/assets/520fc7df-bf01-4ef2-887a-b4e651f4035c) ## Additional Context Also includes a bunch of small refactors to make it easier to test that something is a function completion item regardless of whether it ends up being a snippet completion or not, whether it triggers a command, etc. ## Documentation Check one: - [x] 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.
nightly-2024-09-10: fix: suggest trait attributes in LSP (#5972)
# Description ## Problem I noticed LSP didn't suggest trait attributes... because these weren't visited. I also noticed when an attribute related to a function was suggested, but the function only had one argument, the parentheses were included in the suggestion but they aren't needed. ## Summary Fixes the above problems. ![lsp-trait-attribute](https://github.com/user-attachments/assets/16cdd8ab-1d03-40d1-a1b1-19b26d88e322) ## Additional Context ## Documentation Check one: - [x] 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.
nightly-2024-09-09: fix(mem2reg): Handle aliases in function last store cleanup and addit…
nightly-2024-09-09: fix(mem2reg): Handle aliases in function last store cleanup and addit…
Pre-release
Pre-release
…ional alias unit test (#5967) # Description ## Problem\* Partially https://github.com/noir-lang/noir/pull/5925#issuecomment-2332383904 and benefits other post mem2reg function cleanup work https://github.com/noir-lang/noir/pull/5925. Want to add some more aliasing cases. Works towards making the alias testing surrounding mem2reg more robust. ## Summary\* I have added a mem2reg unit test where the code is storing to an alias inside of a loop. This triggered a failure that has been fixed in this PR. I also confirmed that this unit test would have caught the error triggered by #5935 in https://github.com/AztecProtocol/aztec-packages/pull/8378. We have a simple post-mem2reg process that operates over the final mem2reg state to determine if there are any stores that were missed that can be removed. The check currently does not look at whether the store we are removing is an alias. For now I simply block removing this store if it is an alias. ## Additional Context In follow-ups we can work on handling of aliases in this per function state to remove aliases we know we can simplify. ## Documentation\* Check one: - [X] 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.
nightly-2024-09-08: fix(mem2reg): Handle aliases in function last store cleanup and addit…
nightly-2024-09-08: fix(mem2reg): Handle aliases in function last store cleanup and addit…
Pre-release
Pre-release
…ional alias unit test (#5967) # Description ## Problem\* Partially https://github.com/noir-lang/noir/pull/5925#issuecomment-2332383904 and benefits other post mem2reg function cleanup work https://github.com/noir-lang/noir/pull/5925. Want to add some more aliasing cases. Works towards making the alias testing surrounding mem2reg more robust. ## Summary\* I have added a mem2reg unit test where the code is storing to an alias inside of a loop. This triggered a failure that has been fixed in this PR. I also confirmed that this unit test would have caught the error triggered by #5935 in https://github.com/AztecProtocol/aztec-packages/pull/8378. We have a simple post-mem2reg process that operates over the final mem2reg state to determine if there are any stores that were missed that can be removed. The check currently does not look at whether the store we are removing is an alias. For now I simply block removing this store if it is an alias. ## Additional Context In follow-ups we can work on handling of aliases in this per function state to remove aliases we know we can simplify. ## Documentation\* Check one: - [X] 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.