Skip to content

v2.9.0

Compare
Choose a tag to compare
@github-actions github-actions released this 28 Nov 13:42
· 103 commits to main since this release
3c5a2f4

New Features

  • Global uses.
    • use a::b::* would bring the public context from a::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 or use 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.
  • 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 enforce Deref on T to be available and with associated type Item of type S.
  • 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. in metaprogramming.cairo by @feltroidprime in #6500
  • Added Pow trait and implementations for base numeric types and usize. #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

New Contributors

Full Changelog: v2.8.5...v2.9.0