v2.9.0
New Features
- Global uses.
use a::b::*
would bring the public context froma::b
into the current context.- Not available for use on crates with edition
v2023_01
.
- Basic closures:
let plus_1 = |x| x + 1;
assert_eq!(plus_1(5), 6);
- Formatter Improvements:
- Sorting of module level items only sorts on subsequent
mod
statements oruse
statements. - Removal of extra unnecessary commas at the end of one line lists.
- Addition of extra comma at the end of multi line lists.
- Sort of internal nodes within
use
items. - Merging of subsequent
use
items. - Fix formatting precedence of for loop parts. #6371
- Formatting long arrays with multiple elements per line.
- Sorting of module level items only sorts on subsequent
- Experimental feature -
#[executable]
attribute, to mark a function for execution generating proofs off-chain. - Experimental feature - Associated type bounds
- requires experimental flag -
associated_item_constraints
- Example:
fn foo<T, S, +Iterator::<T>[Item: S]>(t: T) { ... }
- will enforceDeref
onT
to be available and with associated typeItem
of typeS
.
- requires experimental flag -
const
statements are now allowed within code blocks (not just as a module item).use
of consts and types are no allowed within code blocks.- Support format!("{:x}") notation for hexadecimal formatting by @remybar in #6297
- Implement Zero for u384 by @enitrat in #6329
- Add conescutive math operator diagnostic to the parser. #6392
- Disabled inline macro expansion on parser errors. #6413
- Added analyzer check for enums with starknet::Store with no default. #6459
- Add missing
TupleSplitTupleSize16
impl. inmetaprogramming.cairo
by @feltroidprime in #6500 - Added
Pow
trait and implementations for base numeric types andusize
. #6694 - Added option to allow conflicting paths. #6743
- Added option for renaming a storage variable path. #6758
Bug Fixes
- Made non-copy variable not be forwarded in const folding. #6324
- Allow defining const negative
NonZero
. #6425 - Fixed self-ref type detection. #6455
- Somewhat improved diagnostics location occuring from final solve. #6586
- Solving current inference state prior to finding index traits. #6587
- Fixed issue with consts defined out of order. #6625
- Changed ap-change-only solver to be the linear solver. #6626
- Treating all gas-vars as provided 0 if gas is disabled. #6688
- Handling attributes on members and variants. #6738
- Fixed issue with using a box of const as actual const. #6766
Optimizations
- Match optimization now happens in more complex cases as well.
- Additional cases of const-folding.
- Optimized
BitNot
by BoundedInt. #6416 - Enabled bounded-int
abs
optimization in i128 mul. #6417 - Made signed int add and sub more efficient. #6465
Language Server Updates
- Refresh project on
cairo_project.toml
change, register text document sync on server side. #6316 - Fix duplicated and misplaced diagnostics. #6446
- Add completions of struct members. #6567
- Add "fill struct fields" code action. #6565
- Limit module import completion to visible members. #6566
- Add hovers for path segments. #6649
- Support multi-root-workspaces. #6645
Other
- Remove all instances of inline(always) from corelib by @javra in #6114
- Update README by @Olexandr88 in #6373
- corelib: circuit related utils improvements by @feltroidprime in #6482
- Fix Typos in Documentation Files by @cypherpepe in #6677
- Typo Update readme.md by @mdqst in #6693
- Grammar and Style Improvements by @Madmaxs2 in #6747
New Contributors
- @remybar made their first contribution in #6297
- @Olexandr88 made their first contribution in #6373
- @Oemerbeck made their first contribution in #6400
- @feltroidprime made their first contribution in #6482
- @marcuspang made their first contribution in #6497
- @integraledelebesgue made their first contribution in #6478
- @cypherpepe made their first contribution in #6677
- @Gerson2102 made their first contribution in #6627
- @mdqst made their first contribution in #6693
- @Madmaxs2 made their first contribution in #6747
Full Changelog: v2.8.5...v2.9.0