Support for Pattern Matching in Closure Parameters #1540
FanelliMarco
started this conversation in
Feature requests
Replies: 2 comments
|
Thank you for the feature request. We generally keep track of these (as they may require design) as discussions. I'll move it there. |
0 replies
|
Hi, has there been any progress on pattern matching in closure parameters since this discussion started? |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Description:
Currently, Verus does not support pattern matching in closure parameters. When attempting to use pattern matching, such as destructuring a tuple in the parameter list, Verus throws an error:
This limitation restricts the use of idiomatic Rust patterns in Verus-verified code, making it harder to write expressive and readable functional code.
Proposed Solution:
Extend Verus to support pattern matching in closure parameters, particularly for tuple destructuring. This would allow expressions like the following to be verified successfully:
Impact:
Additional Context:
All reactions