New Features
-
Added forwarding option for Starknet interfaces. #9847
Auto-generated forwarding impls can now be created for Starknet interfaces. This makes it easy to include interfaces declared in other contracts by forwarding the library calls. -
Extensive macro system diagnostics improvements. #9842 #9844
#9845 #9846
The macro system received several improvements in robustness and diagnostics:- Parser now emits E1031 when a macro repetition group
$(...)is missing its required?,+, or*operator. - Macro rules with declaration-time errors are now tracked and skipped during expansion, preventing panics on broken rules.
- A no-progress guard prevents infinite loops when repetition patterns match zero tokens.
- Declaration-time diagnostics now validate placeholder usage in expansion patterns: E2198 is emitted when a placeholder is used outside its required repetition depth, and E2199 when placeholders from different repetition contexts are mixed in the same expansion block.
- Parser now emits E1031 when a macro repetition group
Optimizations
Compiler Runtime
- Removed no longer required extra gas-withdraw from Starknet entrypoint wrappers. #9792
- Made apply optimizations trait-based for a unified interface. #9838
- Made less calculations in BigInt and conversions. #9696
- Eliminated redundant clone in
store_variablesinvocation handling. #9715 - Removed redundant clone in implicits goto remapping. #9782
- Avoided clone in
lower_expr_desnapby matchingLoweredExprby value. #9712 - Avoided redundant
Rcallocations in reboxing loop. #9706 - Removed unnecessary Vec allocation in
split_structs. #9654 - Removed redundant clone in
store_localcalls. #9694 - Removed unnecessary vector clone in closure capture. #9691
- Much smaller clones in usages analysis. #9641
- Removed redundant HashMap lookup in SCC algorithm. #9650
- Used Entry API in
add_dropto reduce hash lookups. #9674
New Contributors
Full Changelog: v2.17.0...v2.18.0